]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11785 [mod_commands] scan-build thinks NULL parameter is being passed to function...
authorChris Rienzo <chris@signalwire.com>
Mon, 15 Apr 2019 20:38:52 +0000 (16:38 -0400)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 16:21:19 +0000 (20:21 +0400)
src/mod/applications/mod_commands/mod_commands.c

index 2cb7d413ad1c266ccd94ef0481611c634a5fce73..df7485c9be06fc44788f2ca07d1a5d36035a0253 100644 (file)
@@ -5743,7 +5743,7 @@ SWITCH_STANDARD_API(show_function)
                        if (argv[1] && !strcasecmp(argv[1], "count")) {
                                switch_snprintfv(sql, sizeof(sql), "select count(*) from basic_calls where hostname='%q'", switch_core_get_switchname());
                                holder.justcount = 1;
-                               if (argv[3] && !strcasecmp(argv[2], "as")) {
+                               if (argv[2] && argv[3] && !strcasecmp(argv[2], "as")) {
                                        as = argv[3];
                                }
                        }
@@ -5752,7 +5752,7 @@ SWITCH_STANDARD_API(show_function)
                        if (argv[1] && !strcasecmp(argv[1], "count")) {
                                switch_snprintfv(sql, sizeof(sql), "select count(*) from registrations where hostname='%q'", switch_core_get_switchname());
                                holder.justcount = 1;
-                               if (argv[3] && !strcasecmp(argv[2], "as")) {
+                               if (argv[2] && argv[3] && !strcasecmp(argv[2], "as")) {
                                        as = argv[3];
                                }
                        }
@@ -5784,7 +5784,7 @@ SWITCH_STANDARD_API(show_function)
                        if (argv[1] && !strcasecmp(argv[1], "count")) {
                                switch_snprintfv(sql, sizeof(sql), "select count(*) from channels where hostname='%q'", switch_core_get_switchname());
                                holder.justcount = 1;
-                               if (argv[3] && !strcasecmp(argv[2], "as")) {
+                               if (argv[2] && argv[3] && !strcasecmp(argv[2], "as")) {
                                        as = argv[3];
                                }
                        }