From: Mathieu Rene Date: Mon, 19 Jul 2010 15:50:15 +0000 (-0400) Subject: mod_hash: fix null check on API X-Git-Tag: v1.2-rc1~541^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52c278c2e1b820e4a5f329a83f50757ab5248fde;p=thirdparty%2Ffreeswitch.git mod_hash: fix null check on API --- diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index ae5f56d5a2..126d9f3a26 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -572,10 +572,13 @@ SWITCH_STANDARD_API(hash_remote_function) char *argv[10]; char *dup = NULL; - if (!zstr(cmd)) { - dup = strdup(cmd); + if (zstr(cmd)) { + stream->write_function(stream, "-ERR Usage: "HASH_REMOTE_SYNTAX"\n"); + return SWITCH_STATUS_SUCCESS; } + dup = strdup(cmd); + argc = switch_split(dup, ' ', argv); if (argv[0] && !strcmp(argv[0], "list")) { switch_hash_index_t *hi;