From: Kevin Harwell Date: Fri, 6 Jul 2018 20:05:47 +0000 (-0500) Subject: res_pjsip_session: sdp group:BUNDLE attribute being truncated X-Git-Tag: 15.6.0-rc1~108^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9312aaa4f927df7d56a83a975b35351747d914c;p=thirdparty%2Fasterisk.git res_pjsip_session: sdp group:BUNDLE attribute being truncated When setting/appending the media id's to the bundle group attribute a '-1' was being passed to the 'ast_str_set/append' function for the 'max_len' parameter. This essentially capped the length of the string to what it was originally allocated with. In this case 64 bytes. This patch makes it so a '0' is passed as in for the 'max_len', which means "no maximum length". ASTERISK-27955 #close Change-Id: Iec565df6600401d54a502854a53d19bb4cc34876 --- diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index 90198e200d..496cf5e7d6 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -3847,14 +3847,14 @@ static int add_bundle_groups(struct ast_sip_session *session, pj_pool_t *pool, p continue; } - ast_str_set(&bundle_group->attr_string, -1, "BUNDLE %s", session_media->mid); + ast_str_set(&bundle_group->attr_string, 0, "BUNDLE %s", session_media->mid); continue; } for (mid_id = 1; mid_id < PJMEDIA_MAX_SDP_MEDIA; ++mid_id) { if (!bundle_group->mids[mid_id]) { bundle_group->mids[mid_id] = session_media->mid; - ast_str_append(&bundle_group->attr_string, -1, " %s", session_media->mid); + ast_str_append(&bundle_group->attr_string, 0, " %s", session_media->mid); break; } else if (!strcmp(bundle_group->mids[mid_id], session_media->mid)) { break;