[Asterisk-code-review] res rtp multicast: Fix SEGV in ast multicast rtp create opt... (asterisk[master])
Anonymous Coward
asteriskteam at digium.com
Wed Aug 24 19:02:51 CDT 2016
Anonymous Coward #1000019 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
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 5a7b26b..fce4926 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/3697
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib845eae46a67a9787e89a87ebd1027344e5e0362
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
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-code-review
mailing list