[asterisk-bugs] [Asterisk 0010502]: Check for callerid being present is incomplete.

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Aug 21 12:03:00 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10502 
====================================================================== 
Reported By:                dswartz
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10502
Category:                   Applications/app_zapateller
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.10.1  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             08-20-2007 16:42 CDT
Last Modified:              08-21-2007 12:03 CDT
====================================================================== 
Summary:                    Check for callerid being present is incomplete.
Description: 

The check currently is:

if (chan->cid.cid_num && nocallerid) {

This is fine if there never was a CID number.  If there was a string
present, but it was nulled out by an AGI script (or some context code),
this pointer will still be non-null, but will point (correctly) to a null
string.  Check should be more like:

if (chan->cid.cid_num && strlen(chan->cid.cid_num) && nocallerid) {

p.s. I have submitted a license and am waiting for approval.
====================================================================== 

---------------------------------------------------------------------- 
 dswartz - 08-21-07 12:03  
---------------------------------------------------------------------- 
--- app_zapateller.c~   2007-08-20 17:46:17.000000000 -0400
+++ app_zapateller.c    2007-08-21 13:17:42.000000000 -0400
@@ -85,7 +85,7 @@
                        res = ast_safe_sleep(chan, 500);
                }
        }
-       if (chan->cid.cid_num && strlen(chan->cid.cid_num) && nocallerid)
{
+       if (!ast_strlen_zero(chan->cid.cid_num) && nocallerid) {
                ast_module_user_remove(u);
                return res;
        } 

I have verified this works as expected. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-21-07 12:03  dswartz        Note Added: 0069186                          
======================================================================




More information about the asterisk-bugs mailing list