mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
Adding a check for reverse overflow when extensions is longer than filename
This commit is contained in:
parent
0e4cb93bc5
commit
32230ae648
@ -1300,8 +1300,8 @@ bool core_filename_ends_with(const std::string &filename, const std::string &ext
|
||||
auto extlen = extension.length();
|
||||
bool matches = true;
|
||||
|
||||
/* work backwards checking for a match */
|
||||
while (extlen > 0)
|
||||
// work backwards checking for a match
|
||||
while (extlen > 0 && namelen > 0)
|
||||
if (tolower((UINT8)filename[--namelen]) != tolower((UINT8)extension[--extlen]))
|
||||
{
|
||||
matches = false;
|
||||
|
Loading…
Reference in New Issue
Block a user