[Freeswitch-svn] [commit] r2322 - freeswitch/trunk/src/mod/endpoints/mod_exosip

Freeswitch SVN mikej at freeswitch.org
Thu Aug 17 21:23:19 EDT 2006


Author: mikej
Date: Thu Aug 17 21:23:18 2006
New Revision: 2322

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_exosip/mod_exosip.c

Log:
fix segfault when there is a malformed registration in the db.

Modified: freeswitch/trunk/src/mod/endpoints/mod_exosip/mod_exosip.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_exosip/mod_exosip.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_exosip/mod_exosip.c	Thu Aug 17 21:23:18 2006
@@ -1000,11 +1000,13 @@
 static int del_callback(void *pArg, int argc, char **argv, char **columnNames){
 	switch_event_t *s_event;
 
-	if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_EXPIRE) == SWITCH_STATUS_SUCCESS) {
-		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "key", "%s", argv[0]);
-		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "url", "%s", argv[1]);
-		switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%d", argv[2]);
-		switch_event_fire(&s_event);
+	if (argc >=3 ) {
+		if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_EXPIRE) == SWITCH_STATUS_SUCCESS) {
+			switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "key", "%s", argv[0]);
+			switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "url", "%s", argv[1]);
+			switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%d", argv[2]);
+			switch_event_fire(&s_event);
+		}
 	}
 	return 0;
 }



More information about the Freeswitch-svn mailing list