]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11108: [mod_commands] Fix segfault with list_users command
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Thu, 12 Apr 2018 23:14:17 +0000 (19:14 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Thu, 12 Apr 2018 23:14:17 +0000 (19:14 -0400)
src/mod/applications/mod_commands/mod_commands.c

index 064978ad8c8cc102ac233359eae42a702e8aec25..1ea0b59a2155a1b5ab4d7516d6dc05ccd92081e2 100644 (file)
@@ -414,7 +414,7 @@ void output_flattened_dial_string(char *data, switch_stream_handle_t *stream)
 SWITCH_STANDARD_API(list_users_function)
 {
        int argc;
-       char *pdata, *argv[9];
+       char *pdata = NULL, *argv[9];
        int32_t arg = 0;
        switch_xml_t xml_root, x_domains, x_domain_tag;
        switch_xml_t gts, gt, uts, ut;
@@ -422,7 +422,7 @@ SWITCH_STANDARD_API(list_users_function)
        char *tag_name = NULL, *key_name = NULL, *key_value = NULL;
        char *_domain = NULL;
 
-       if ((pdata = strdup(cmd))) {
+       if (!zstr(cmd) && (pdata = strdup(cmd))) {
                argc = switch_separate_string(pdata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 
                if (argc >= 9) {