static analyzer: use of uninitialized value 'origarg'

../sys/unix/unixmain.c: In function ‘process_options’:
  ../sys/unix/unixmain.c:458:9: warning: use of uninitialized value ‘origarg’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
    458 |         config_error_add("Unknown option: %.60s", origarg);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
nhmall
2026-08-21 09:36:17 -04:00
parent c99b485c78
commit 44b04064be
+2 -2
View File
@@ -328,7 +328,7 @@ main(int argc, char *argv[])
static void
process_options(int argc, char *argv[])
{
char *arg, *origarg;
char *arg, *origarg = 0;
int i, l;
config_error_init(FALSE, "command line", FALSE);
@@ -454,7 +454,7 @@ process_options(int argc, char *argv[])
}
}
if (argc > 1)
if (argc > 1 && origarg)
config_error_add("Unknown option: %.60s", origarg);
#ifdef MAX_NR_OF_PLAYERS
/* limit to compile-time limit */