]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Initialize stack-allocated ast_sockaddrs before use
authorTerry Wilson <twilson@digium.com>
Thu, 26 May 2011 17:29:54 +0000 (17:29 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 26 May 2011 17:29:54 +0000 (17:29 +0000)
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.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@321042 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/rtp_engine.c

index b2b498f13abb8a1dba330af137c096791ebe71af..f97e54bea076262040b5092a469f183bfa9d202c 100644 (file)
@@ -1246,7 +1246,7 @@ enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct as
                        *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;