[asterisk-commits] file: trunk r405020 - in /trunk: ./ res/res_pjsip_nat.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 7 08:56:12 CST 2014


Author: file
Date: Tue Jan  7 08:56:10 2014
New Revision: 405020

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405020
Log:
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

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_nat.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/res/res_pjsip_nat.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_nat.c?view=diff&rev=405020&r1=405019&r2=405020
==============================================================================
--- trunk/res/res_pjsip_nat.c (original)
+++ trunk/res/res_pjsip_nat.c Tue Jan  7 08:56:10 2014
@@ -42,7 +42,7 @@
 	}
 
 	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);




More information about the asterisk-commits mailing list