]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_hash: fix null check on API
authorMathieu Rene <mrene@avgs.ca>
Mon, 19 Jul 2010 15:50:15 +0000 (11:50 -0400)
committerMathieu Rene <mrene@avgs.ca>
Mon, 19 Jul 2010 15:50:15 +0000 (11:50 -0400)
src/mod/applications/mod_hash/mod_hash.c

index ae5f56d5a2edb48115e3e26fba1826b614207b24..126d9f3a26e3f7f233da11611405bc3257aae520 100644 (file)
@@ -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;