[asterisk-bugs] [Asterisk 0018640]: [patch] Potential malfunction due to unitialized local variable

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 6 13:03:14 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18640 
====================================================================== 
Reported By:                jcovert
Assigned To:                seanbright
====================================================================== 
Project:                    Asterisk
Issue ID:                   18640
Category:                   Channels/chan_sip/General
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.8 
SVN Revision (number only!): 302314 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2011-01-18 19:39 CST
Last Modified:              2011-05-06 13:03 CDT
====================================================================== 
Summary:                    [patch] Potential malfunction due to unitialized
local variable
Description: 
The compiler correctly reports:

In function 'parse_register_contact':
'single_binding_found' may be used uninitialized

Upon inspection, if (!strcasecmp(curi, "*")) we will set wildcard = 1 and
single_binding_found will have a random value, since initialization of
local variables is undefined.

At the next line:

if (wildcard_found && (ast_strlen_zero(expires) || expire != 0 ||
single_binding_found))

we now test single binding found in an "or", and the result will be
random.

A patch to 1.8 head is provided.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0018785 [patch] Regression after r297603 (Impro...
====================================================================== 

---------------------------------------------------------------------- 
 (0134584) svnbot (reporter) - 2011-05-06 13:03
 https://issues.asterisk.org/view.php?id=18640#c134584 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 317720

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_sip.c

------------------------------------------------------------------------
r317720 | rmudgett | 2011-05-06 13:03:13 -0500 (Fri, 06 May 2011) | 18
lines

Merged revisions 317719 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r317719 | rmudgett | 2011-05-06 12:59:05 -0500 (Fri, 06 May 2011) | 11
lines
  
  Regression after r297603 (Improve handling of REGISTER requests with
multiple contact headers.) 
  
  Uninitialized variable.
  
  (issue https://issues.asterisk.org/view.php?id=18640)
  
  (closes issue https://issues.asterisk.org/view.php?id=18785)
  Reported by: pnlarsson
  Patches:
        issue18785_enegaard.patch uploaded by enegaard (license 1197)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=317720 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-06 13:03 svnbot         Checkin                                      
2011-05-06 13:03 svnbot         Note Added: 0134584                          
======================================================================




More information about the asterisk-bugs mailing list