From: Seven Du Date: Thu, 8 Jan 2015 03:38:53 +0000 (+0800) Subject: follow commit 0bec209a, we should still allow NULL arg X-Git-Tag: v1.4.16~1^2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ed290e9304a687df1519c67c0a1fb868691db58;p=thirdparty%2Ffreeswitch.git follow commit 0bec209a, we should still allow NULL arg --- diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 55411371c6..08f4a5095c 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -3583,15 +3583,14 @@ static switch_bool_t jsapi_func(const char *method, cJSON *params, jsock_t *jsoc if (jsock->allowed_fsapi && !strcmp(function, "fsapi")) { cJSON *data = cJSON_GetObjectItem(params, "data"); - cJSON *cmd; - cJSON *arg; - - if (data && - (cmd = cJSON_GetObjectItem(data, "cmd")) && - (arg = cJSON_GetObjectItem(data, "arg")) && - cmd->type == cJSON_String && cmd->valuestring && - !auth_api_command(jsock, cmd->valuestring, arg ? arg->valuestring : NULL)) { - return SWITCH_FALSE; + if (data) { + cJSON *cmd = cJSON_GetObjectItem(data, "cmd"); + cJSON *arg = cJSON_GetObjectItem(data, "arg"); + + if (cmd && cmd->type == cJSON_String && cmd->valuestring && + !auth_api_command(jsock, cmd->valuestring, arg ? arg->valuestring : NULL)) { + return SWITCH_FALSE; + } } } }