mirror of https://github.com/ipxe/ipxe.git
Do not go past the end of the argv[] array.
This bug found by setting read and write watchpoints at NULL in bochs.pull/1/head
parent
55e6d7b70c
commit
98240d99f0
|
@ -227,6 +227,10 @@ int getopt_long ( int argc, char * const argv[], const char *optstring,
|
|||
enum getopt_argument_requirement has_arg;
|
||||
int option;
|
||||
|
||||
/* Check for end of argv array */
|
||||
if ( optind >= argc )
|
||||
return -1;
|
||||
|
||||
/* Check for end of options */
|
||||
if ( *(opttext++) != '-' )
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue