[asterisk-commits] mjordan: branch 12 r402941 - /branches/12/res/res_pjsip_sdp_rtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 21 11:52:13 CST 2013


Author: mjordan
Date: Thu Nov 21 11:52:11 2013
New Revision: 402941

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402941
Log:
res_pjsip_sdp_rtp: Fix use of uninitialized value in PJSIP

In PJMEDIA, pjmedia_sdp_rtpmap_to_attr will attempt to use the string
rtpmap.param regardless of its length value. Simply setting the length to 0
does not prevent the garbage on the stack in rtpmap.param.ptr from being
formatted in a sprintf call. This patch initializes the string to NULL so that
at the very least, something is provided to the function that is predictable.

Modified:
    branches/12/res/res_pjsip_sdp_rtp.c

Modified: branches/12/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_sdp_rtp.c?view=diff&rev=402941&r1=402940&r2=402941
==============================================================================
--- branches/12/res/res_pjsip_sdp_rtp.c (original)
+++ branches/12/res/res_pjsip_sdp_rtp.c Thu Nov 21 11:52:11 2013
@@ -274,6 +274,7 @@
 	rtpmap.clock_rate = ast_rtp_lookup_sample_rate2(asterisk_format, format, code);
 	pj_strdup2(pool, &rtpmap.enc_name, ast_rtp_lookup_mime_subtype2(asterisk_format, format, code, 0));
 	rtpmap.param.slen = 0;
+	rtpmap.param.ptr = NULL;
 
 	pjmedia_sdp_rtpmap_to_attr(pool, &rtpmap, &attr);
 




More information about the asterisk-commits mailing list