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

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 17 18:25:14 CST 2009


The following issue is now READY FOR REVIEW. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16261 
====================================================================== 
Reported By:                edguy3
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16261
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for review
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:              
====================================================================== 
Date Submitted:             2009-11-17 07:17 CST
Last Modified:              2009-11-17 18:25 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) 
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-17 18:25 tilghman       Status                   acknowledged => ready
for review
======================================================================




More information about the asterisk-bugs mailing list