From: Chris Rienzo Date: Mon, 15 Apr 2019 20:38:52 +0000 (-0400) Subject: FS-11785 [mod_commands] scan-build thinks NULL parameter is being passed to function... X-Git-Tag: v1.10.0~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1df7742156b5515adc69cbabfee7f6b47a06c5;p=thirdparty%2Ffreeswitch.git FS-11785 [mod_commands] scan-build thinks NULL parameter is being passed to function. Shouldn't actually happen. --- diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 2cb7d413ad..df7485c9be 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -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]; } }