[Freeswitch-trunk] [commit] r6894 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN mikej at freeswitch.org
Tue Dec 18 22:34:37 EST 2007


Author: mikej
Date: Tue Dec 18 22:34:37 2007
New Revision: 6894

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
protect against null deref.

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Tue Dec 18 22:34:37 2007
@@ -1807,7 +1807,11 @@
 							switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 							uint32_t timeout = 60;
 							char *tuuid_str;
-							const char *port = refer_to->r_url->url_port;
+							const char *port = NULL;
+							
+							if (refer_to && refer_to->r_url && refer_to->r_url->url_port) {
+								port = refer_to->r_url->url_port;
+							}
 
 							if (switch_strlen_zero(port)) {
 								port = "5060";



More information about the Freeswitch-trunk mailing list