[Asterisk-code-review] res pjsip session: sdp group:BUNDLE attribute being truncated (asterisk[15])

Kevin Harwell asteriskteam at digium.com
Fri Jul 6 15:11:34 CDT 2018


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/9373


Change subject: res_pjsip_session: sdp group:BUNDLE attribute being truncated
......................................................................

res_pjsip_session: sdp group:BUNDLE attribute being truncated

When appending the media id's to the bundle group attribute a '-1' was being
passed to the 'ast_str_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
---
M res/res_pjsip_session.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/9373/1

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 90198e2..cd43f97 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -3854,7 +3854,7 @@
 		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;

-- 
To view, visit https://gerrit.asterisk.org/9373
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec565df6600401d54a502854a53d19bb4cc34876
Gerrit-Change-Number: 9373
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180706/030e3e59/attachment.html>


More information about the asterisk-code-review mailing list