[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:31:36 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
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:                     closed
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:31 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) 
====================================================================== 

---------------------------------------------------------------------- 
 (0114295) svnbot (reporter) - 2009-11-25 15:31
 https://issues.asterisk.org/view.php?id=16261#c114295 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 231234

_U  trunk/

------------------------------------------------------------------------
r231234 | dvossel | 2009-11-25 15:31:35 -0600 (Wed, 25 Nov 2009) | 13
lines

Blocked revisions 231233 via svnmerge

........
  r231233 | dvossel | 2009-11-25 15:23:41 -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=231234 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-25 15:31 svnbot         Checkin                                      
2009-11-25 15:31 svnbot         Note Added: 0114295                          
======================================================================




More information about the asterisk-bugs mailing list