diff options
author | Joshua Colp <jcolp@digium.com> | 2016-08-24 18:53:45 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-08-24 18:53:45 -0500 |
commit | 4e5b930d3fa11012513a1ba37d2cf7c0068b6407 (patch) | |
tree | 542a6700dd5334ccb90cd7734f2ffae2496307e6 | |
parent | cb8fd610e20fef4de5f779fda33af7795c9e8a5b (diff) | |
parent | c9e83f6d0be9d89a3beaa509b46c423d78fac6d1 (diff) |
Merge "res_rtp_multicast: Fix SEGV in ast_multicast_rtp_create_options" into 13
-rw-r--r-- | res/res_rtp_multicast.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/res/res_rtp_multicast.c b/res/res_rtp_multicast.c index 53bdf14a4..ea313476e 100644 --- a/res/res_rtp_multicast.c +++ b/res/res_rtp_multicast.c @@ -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) + strlen(type) - + strlen(options) + 2); + + strlen(S_OR(options, "")) + 2); if (!mcast_options) { return NULL; } @@ -155,8 +155,9 @@ struct ast_multicast_rtp_options *ast_multicast_rtp_create_options(const char *t 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, |