Merge "res_rtp_multicast: Fix SEGV in ast_multicast_rtp_create_options" into 13

changes/06/3706/1
Joshua Colp 9 years ago committed by Gerrit Code Review
commit 4e5b930d3f

@ -143,7 +143,7 @@ struct ast_multicast_rtp_options *ast_multicast_rtp_create_options(const char *t
mcast_options = ast_calloc(1, sizeof(*mcast_options) mcast_options = ast_calloc(1, sizeof(*mcast_options)
+ strlen(type) + strlen(type)
+ strlen(options) + 2); + strlen(S_OR(options, "")) + 2);
if (!mcast_options) { if (!mcast_options) {
return NULL; return NULL;
} }
@ -155,8 +155,9 @@ struct ast_multicast_rtp_options *ast_multicast_rtp_create_options(const char *t
mcast_options->type = pos; mcast_options->type = pos;
pos += strlen(type) + 1; pos += strlen(type) + 1;
/* Safe */ if (!ast_strlen_zero(options)) {
strcpy(pos, options); strcpy(pos, options); /* Safe */
}
mcast_options->options = pos; mcast_options->options = pos;
if (ast_app_parse_options(multicast_rtp_options, &mcast_options->opts, if (ast_app_parse_options(multicast_rtp_options, &mcast_options->opts,

Loading…
Cancel
Save