From e21b182e6c41d005f2b32ccfc37c32a9c745a6b6 Mon Sep 17 00:00:00 2001 From: Fernando Carmona Varo Date: Sat, 12 Oct 2019 12:37:44 +0200 Subject: [PATCH] Skip invalid first level entries in umapinfo --- src/u_mapinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/u_mapinfo.c b/src/u_mapinfo.c index 41ebc707..473cf34f 100644 --- a/src/u_mapinfo.c +++ b/src/u_mapinfo.c @@ -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); @@ -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.