[asterisk-commits] res rtp multicast: Fix SEGV in ast multicast rtp create opt... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 24 18:53:45 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res_rtp_multicast:  Fix SEGV in ast_multicast_rtp_create_options
......................................................................


res_rtp_multicast:  Fix SEGV in ast_multicast_rtp_create_options

ast_multicast_rtp_create_options now checks for NULL or empty options

Change-Id: Ib845eae46a67a9787e89a87ebd1027344e5e0362
---
M res/res_rtp_multicast.c
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_rtp_multicast.c b/res/res_rtp_multicast.c
index 53bdf14..ea31347 100644
--- a/res/res_rtp_multicast.c
+++ b/res/res_rtp_multicast.c
@@ -143,7 +143,7 @@
 
 	mcast_options = ast_calloc(1, sizeof(*mcast_options)
 			+ strlen(type)
-			+ strlen(options) + 2);
+			+ strlen(S_OR(options, "")) + 2);
 	if (!mcast_options) {
 		return NULL;
 	}
@@ -155,8 +155,9 @@
 	mcast_options->type = pos;
 	pos += strlen(type) + 1;
 
-	/* Safe */
-	strcpy(pos, options);
+	if (!ast_strlen_zero(options)) {
+		strcpy(pos, options); /* Safe */
+	}
 	mcast_options->options = pos;
 
 	if (ast_app_parse_options(multicast_rtp_options, &mcast_options->opts,

-- 
To view, visit https://gerrit.asterisk.org/3695
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib845eae46a67a9787e89a87ebd1027344e5e0362
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list