[Freeswitch-svn] [commit] r4378 - freeswitch/trunk/src/mod/applications/mod_commands

Freeswitch SVN mikej at freeswitch.org
Fri Feb 23 16:00:21 EST 2007


Author: mikej
Date: Fri Feb 23 16:00:20 2007
New Revision: 4378

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c

Log:
fix segfault on incorrect usage of originate api command (jira MODAPP-2)

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Fri Feb 23 16:00:20 2007
@@ -522,10 +522,10 @@
 	assert(caller_channel != NULL);
 	switch_channel_clear_state_handler(caller_channel, NULL);
 
-	if (*exten == '&') {
+	if (*exten == '&'  && *(exten + 1)) {
 		switch_caller_extension_t *extension = NULL;
 		char *app_name = switch_core_session_strdup(caller_session, (exten + 1));
-		char *arg, *e;
+		char *arg = NULL, *e;
 
 		if ((e = strchr(app_name, ')'))) {
 			*e = '\0';



More information about the Freeswitch-svn mailing list