mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
res_pjsip_nat: Don't assume a Contact header will always contain a URI.
If the 'rewrite_contact' option was enabled and a Contact header was received which contained a '*' a crash would occur. This change makes the res_pjsip_nat module ignore the Contact header if it contains only a '*'. (closes issue ASTERISK-23101) Reported by: Matt Jordan ........ Merged revisions 405019 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -42,7 +42,7 @@ static pj_bool_t nat_on_rx_message(pjsip_rx_data *rdata)
|
||||
}
|
||||
|
||||
if (endpoint->nat.rewrite_contact && (contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL)) &&
|
||||
(PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
|
||||
!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);
|
||||
|
||||
pj_cstr(&uri->host, rdata->pkt_info.src_name);
|
||||
|
||||
Reference in New Issue
Block a user