]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_aoc: Don't assume a body exists on responses.
authorJoshua C. Colp <jcolp@sangoma.com>
Tue, 13 Dec 2022 15:25:17 +0000 (11:25 -0400)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Tue, 13 Dec 2022 16:52:58 +0000 (10:52 -0600)
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

res/res_pjsip_aoc.c

index dba4e269a85fc6e3122a6c2d49803d5e3baacee4..6e3d81dec67a7d1af07bd1b8532b21db926cb8b2 100644 (file)
@@ -628,7 +628,7 @@ static void aoc_invite_outgoing_response(struct ast_sip_session *session,
                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 {