[asterisk-commits] twilson: branch 1.8 r321042 - /branches/1.8/main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 26 12:29:58 CDT 2011


Author: twilson
Date: Thu May 26 12:29:54 2011
New Revision: 321042

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321042
Log:
Initialize stack-allocated ast_sockaddrs before use

It is important to always initialize ast_sockaddrs before use--even if they
are passed to ast_sockaddr_copy as the underlying storage could be bigger
than what ends up being copied--leaving part of the data unitialized.

Modified:
    branches/1.8/main/rtp_engine.c

Modified: branches/1.8/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/rtp_engine.c?view=diff&rev=321042&r1=321041&r2=321042
==============================================================================
--- branches/1.8/main/rtp_engine.c (original)
+++ branches/1.8/main/rtp_engine.c Thu May 26 12:29:54 2011
@@ -1246,7 +1246,7 @@
 			*vinstance0 = NULL, *vinstance1 = NULL,
 			*tinstance0 = NULL, *tinstance1 = NULL;
 	struct ast_rtp_glue *glue0, *glue1;
-	struct ast_sockaddr addr1, addr2;
+	struct ast_sockaddr addr1 = { {0, }, }, addr2 = { {0, }, };
 	enum ast_rtp_glue_result audio_glue0_res = AST_RTP_GLUE_RESULT_FORBID, video_glue0_res = AST_RTP_GLUE_RESULT_FORBID;
 	enum ast_rtp_glue_result audio_glue1_res = AST_RTP_GLUE_RESULT_FORBID, video_glue1_res = AST_RTP_GLUE_RESULT_FORBID;
 	enum ast_bridge_result res = AST_BRIDGE_FAILED;




More information about the asterisk-commits mailing list