[asterisk-bugs] [Asterisk 0016261]: [patch] Conditional jump or move depends on uninitialised STACK value

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Nov 25 15:30:47 CST 2009


The following issue has been RESOLVED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16261 
====================================================================== 
Reported By:                edguy3
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   16261
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Asterisk Version:           SVN 
JIRA:                       SWP-420 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 230313 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-11-17 07:17 CST
Last Modified:              2009-11-25 15:30 CST
====================================================================== 
Summary:                    [patch] Conditional jump or move depends on
uninitialised STACK value
Description: 
Need to initialize "sin" before accessing its members. 

==31642== Thread 25:
==31642== Conditional jump or move depends on uninitialised value(s)
==31642==    at 0x80D7252: ast_rtp_get_peer (rtp.c:2101)
==31642==    by 0x5D7EB7B: do_monitor (chan_sip.c:16928)
==31642==    by 0x810742B: dummy_start (utils.c:856)

                 /* Might be a timeout now -- see if we're on hold */
                 struct sockaddr_in sin;
                 ast_rtp_get_peer(sip->rtp, &sin);

...
int ast_rtp_get_peer(struct ast_rtp *rtp, struct sockaddr_in *them)
{
        if ((them->sin_family != AF_INET) || ...


Same pattern repeats at line chan_sip.c:5688.

I believe initializing as follows will suffice: 
struct sockaddr_in XXX = { 0, };

( unfortunately, this is not the crash for which I have been valgrinding) 
====================================================================== 

---------------------------------------------------------------------- 
 (0114294) svnbot (reporter) - 2009-11-25 15:30
 https://issues.asterisk.org/view.php?id=16261#c114294 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 231233

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r231233 | dvossel | 2009-11-25 15:30:45 -0600 (Wed, 25 Nov 2009) | 8 lines

fixes conditional jump or move depending on uninitialised STACK value

(closes issue https://issues.asterisk.org/view.php?id=16261)
Reported by: edguy3
Patches:
      edguy16261.patch uploaded by edguy3 (license 917)


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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-25 15:30 svnbot         Checkin                                      
2009-11-25 15:30 svnbot         Note Added: 0114294                          
2009-11-25 15:30 svnbot         Status                   assigned => resolved
2009-11-25 15:30 svnbot         Resolution               open => fixed       
======================================================================




More information about the asterisk-bugs mailing list