From 44b04064be9fcf0658d248ab13314f5b0dd5c688 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 21 Aug 2026 09:36:17 -0400 Subject: [PATCH] static analyzer: use of uninitialized value 'origarg' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- sys/unix/unixmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index c712b08e6..7a0354d17 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -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 */