BASE: Fix potential memory override when parsing long options
This commit is contained in:
parent
a38719640c
commit
a404ddaee6
1 changed files with 1 additions and 1 deletions
|
@ -458,7 +458,7 @@ static Common::String createTemporaryTarget(const Common::String &engineId, cons
|
|||
|
||||
// Use this for options which have an *optional* value
|
||||
#define DO_OPTION_OPT(shortCmd, longCmd, defaultVal) \
|
||||
if (isLongCmd ? (!strcmp(s + 2, longCmd) || !memcmp(s + 2, longCmd"=", sizeof(longCmd"=") - 1)) : (tolower(s[1]) == shortCmd)) { \
|
||||
if (isLongCmd ? (!strcmp(s + 2, longCmd) || !strncmp(s + 2, longCmd"=", sizeof(longCmd"=") - 1)) : (tolower(s[1]) == shortCmd)) { \
|
||||
s += 2; \
|
||||
if (isLongCmd) { \
|
||||
s += sizeof(longCmd) - 1; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue