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:
+2
-2
@@ -328,7 +328,7 @@ main(int argc, char *argv[])
|
|||||||
static void
|
static void
|
||||||
process_options(int argc, char *argv[])
|
process_options(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char *arg, *origarg;
|
char *arg, *origarg = 0;
|
||||||
int i, l;
|
int i, l;
|
||||||
|
|
||||||
config_error_init(FALSE, "command line", FALSE);
|
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);
|
config_error_add("Unknown option: %.60s", origarg);
|
||||||
#ifdef MAX_NR_OF_PLAYERS
|
#ifdef MAX_NR_OF_PLAYERS
|
||||||
/* limit to compile-time limit */
|
/* limit to compile-time limit */
|
||||||
|
|||||||
Reference in New Issue
Block a user