From: Joshua Colp Date: Wed, 3 Sep 2014 14:05:58 +0000 (+0000) Subject: res_pjsip_transport_websocket: Fix crash when the Contact header is not a URI. X-Git-Tag: 14.0.0-beta1~1688 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cd36d0e10f8ab2eb0c703b28c740b91673ace1b;p=thirdparty%2Fasterisk.git res_pjsip_transport_websocket: Fix crash when the Contact header is not a URI. 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 ........ Merged revisions 422557 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 422558 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422559 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c index 00d807f686..7de65dd858 100644 --- a/res/res_pjsip_transport_websocket.c +++ b/res/res_pjsip_transport_websocket.c @@ -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);