From 7e1df7742156b5515adc69cbabfee7f6b47a06c5 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Mon, 15 Apr 2019 16:38:52 -0400 Subject: [PATCH] FS-11785 [mod_commands] scan-build thinks NULL parameter is being passed to function. Shouldn't actually happen. --- src/mod/applications/mod_commands/mod_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]; } }