Geoip: Fix possible crash

This commit is contained in:
Arkshine 2015-01-06 22:36:14 +01:00
parent b883486308
commit a543db5dc6

View File

@ -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. // Dirty fall back to default language ("en") in case provided user's language is not localized.
// Searh "names" position. // Searh "names" position.
while (strcmp(path[i++], "names")); while (path[i] && strcmp(path[i++], "names"));
// No localized entry or we use already default language. // 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; return false;
} }