Skip to content

Commit

Permalink
Skip invalid first level entries in umapinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferk committed Oct 12, 2019
1 parent 2131bbf commit e21b182
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/u_mapinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,10 @@ static int ParseMapEntry(u_scanner_t *s, mapentry_t *val)
{
val->mapname = NULL;

U_MustGetIdentifier(s, "map");
U_MustGetToken(s, TK_Identifier);
if(!U_MustGetIdentifier(s, "map"))
return 0;

U_MustGetToken(s, TK_Identifier);
if (!G_ValidateMapName(s->string, NULL, NULL))
{
U_Error(s, "Invalid map name %s", s->string);
Expand Down Expand Up @@ -340,6 +341,7 @@ int U_ParseMapInfo(const char *buffer, size_t length)
if (!ParseMapEntry(&scanner, &parsed))
{
U_Error(&scanner, "Skipping entry: %s", scanner.string);
continue;
}

// Does this property already exist? If yes, replace it.
Expand Down

0 comments on commit e21b182

Please sign in to comment.