From 099a771ddfcaa2bd927134f64692107e95a36078 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 18 Aug 2006 01:23:18 +0000 Subject: [PATCH] fix segfault when there is a malformed registration in the db. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2322 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_exosip/mod_exosip.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_exosip/mod_exosip.c b/src/mod/endpoints/mod_exosip/mod_exosip.c index 39507fd4e5..6b11374488 100644 --- a/src/mod/endpoints/mod_exosip/mod_exosip.c +++ b/src/mod/endpoints/mod_exosip/mod_exosip.c @@ -1000,11 +1000,13 @@ static int find_callback(void *pArg, int argc, char **argv, char **columnNames){ 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; }