From d9de790ea0f163492aa048e766b59a7fb19f88a5 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 13 Nov 2020 16:26:46 +0100 Subject: [PATCH] fix coverity 305865, add extra checks might quiet the coverity warning --- client/src/proxmark3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 113da7248..539b7a20b 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -898,7 +898,7 @@ int main(int argc, char *argv[]) { // execute pm3 command file if (strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "--script-file") == 0) { - if (i + 1 == argc) { + if (i + 1 == argc || strlen(argv[i + 1]) == 0) { PrintAndLogEx(ERR, _RED_("ERROR:") " missing script file specification after -s\n"); show_help(false, exec_name); return 1; @@ -910,7 +910,7 @@ int main(int argc, char *argv[]) { // execute lua script if (strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "--lua") == 0) { addLuaExec = true; - if (i + 1 == argc) { + if (i + 1 == argc || strlen(argv[i + 1]) == 0) { PrintAndLogEx(ERR, _RED_("ERROR:") " missing lua script specification after -l\n"); show_help(false, exec_name); return 1;