From: Anthony Minessale Date: Fri, 3 Jan 2014 18:43:42 +0000 (+0500) Subject: FS-6074 --resolve X-Git-Tag: v1.4.2~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c5a861b033713a79517637f064ab0d8614733e8;p=thirdparty%2Ffreeswitch.git FS-6074 --resolve --- diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 0c5cd880db..8c0c85911a 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1569,12 +1569,18 @@ static switch_bool_t auth_api_command(listener_t *listener, const char *api_cmd, static switch_status_t parse_command(listener_t *listener, switch_event_t **event, char *reply, uint32_t reply_len) { switch_status_t status = SWITCH_STATUS_SUCCESS; - char *cmd = switch_event_get_header(*event, "command"); + char *cmd = NULL; char unload_cheat[] = "api bgapi unload mod_event_socket"; char reload_cheat[] = "api bgapi reload mod_event_socket"; *reply = '\0'; + if (!event || !*event || !(cmd = switch_event_get_header(*event, "command"))) { + switch_clear_flag_locked(listener, LFLAG_RUNNING); + switch_snprintf(reply, reply_len, "-ERR command parse error."); + goto done; + } + if (switch_stristr("unload", cmd) && switch_stristr("mod_event_socket", cmd)) { cmd = unload_cheat; } else if (switch_stristr("reload", cmd) && switch_stristr("mod_event_socket", cmd)) {