Skip to content
Snippets Groups Projects
Commit f89ab798 authored by Joshua Colp's avatar Joshua Colp
Browse files

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
parent e95e66ce
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment