mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-27 06:11:51 +00:00
Fix null deref where argc = 0
I noticed this on the Wii U emulator Decaf - it sets argc to 0 and, annoyingly, sets up argv so that argv[0] is a bad read. Gah.
This commit is contained in:
parent
7d259b4eaa
commit
738d17ff3b
@ -184,7 +184,7 @@ int getopt_long(int argc, char *argv[],
|
||||
if (optind == 0)
|
||||
optind = 1;
|
||||
|
||||
if (argc == 1)
|
||||
if (argc < 2)
|
||||
return -1;
|
||||
|
||||
short_index = find_short_index(&argv[optind]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user