mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Merge pull request #171 from Arkshine/fix/geoip-invalid-memory
Geoip: Fix possible crash
This commit is contained in:
commit
4a3fcdb937
@ -73,10 +73,10 @@ bool lookupByIp(const char *ip, const char **path, MMDB_entry_data_s *result)
|
||||
// Dirty fall back to default language ("en") in case provided user's language is not localized.
|
||||
|
||||
// Searh "names" position.
|
||||
while (strcmp(path[i++], "names"));
|
||||
while (path[i] && strcmp(path[i++], "names"));
|
||||
|
||||
// No localized entry or we use already default language.
|
||||
if (!*path[i] || !strcmp(path[i], "en"))
|
||||
if (!path[i] || !strcmp(path[i], "en"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user