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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 30 11:56:18 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
(cherry picked from commit c9e83f6d0be9d89a3beaa509b46c423d78fac6d1)
---
M res/res_rtp_multicast.c
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



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/3764
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib845eae46a67a9787e89a87ebd1027344e5e0362
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13.11
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list