]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_transport_websocket: Fix crash when the Contact header is not a URI.
authorJoshua Colp <jcolp@digium.com>
Wed, 3 Sep 2014 14:03:27 +0000 (14:03 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 3 Sep 2014 14:03:27 +0000 (14:03 +0000)
The code for changing the Contact header wrongly assumed that the Contact
would always contain a URI. This is incorrect.

ASTERISK-24271
Reported by: Dafi Ni

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@422557 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip_transport_websocket.c

index cd591866a682b88d9b9f60a366a51df7651f71d6..228326dd7d18a4ccc5d6228250b1807dc5d8defc 100644 (file)
@@ -322,7 +322,7 @@ static pj_bool_t websocket_on_rx_msg(pjsip_rx_data *rdata)
                return PJ_FALSE;
        }
 
-       if ((contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL)) &&
+       if ((contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL)) && !contact->star &&
                (PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
                pjsip_sip_uri *uri = pjsip_uri_get_uri(contact->uri);