mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
Uninitialized variable can cause hardfault from getopt if required argument is missing.
This commit is contained in:
parent
d8da1d61ec
commit
c8b221e03f
1 changed files with 1 additions and 0 deletions
|
|
@ -258,6 +258,7 @@ int getopt(int argc, FAR char *const argv[], FAR const char *optstring)
|
|||
|
||||
/* No argument was supplied */
|
||||
|
||||
g_optptr = NULL;
|
||||
optarg = NULL;
|
||||
optopt = *optchar;
|
||||
optind++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue