[Asterisk-code-review] res_pjsip_aoc: Don't assume a body exists on responses. (asterisk[18])

Joshua Colp asteriskteam at digium.com
Tue Dec 13 09:27:02 CST 2022


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19710 )


Change subject: res_pjsip_aoc: Don't assume a body exists on responses.
......................................................................

res_pjsip_aoc: Don't assume a body exists on responses.

When adding AOC to an outgoing response the code
assumed that a body would exist for comparing the
Content-Type. This isn't always true.

The code now checks to make sure the response has
a body before checking the Content-Type.

ASTERISK-21502

Change-Id: Iaead371434fc3bc693dad487228106a7d7a5ac76
---
M res/res_pjsip_aoc.c
1 file changed, 19 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/19710/1

diff --git a/res/res_pjsip_aoc.c b/res/res_pjsip_aoc.c
index dba4e26..6e3d81d 100644
--- a/res/res_pjsip_aoc.c
+++ b/res/res_pjsip_aoc.c
@@ -628,7 +628,7 @@
 		return;
 	}
 
-	if (pjsip_media_type_cmp(&tdata->msg->body->content_type,
+	if (tdata->msg->body && pjsip_media_type_cmp(&tdata->msg->body->content_type,
 			&pjsip_media_type_multipart_mixed, 0) == 0) {
 		multipart_body = tdata->msg->body;
 	} else {

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Iaead371434fc3bc693dad487228106a7d7a5ac76
Gerrit-Change-Number: 19710
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221213/3b187a80/attachment.html>


More information about the asterisk-code-review mailing list