From 71d701325520671933676dc7ae66349cec3b3925 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Dec 2019 16:42:24 +0100 Subject: [PATCH] - better validation checks for CSV-based string files. --- src/gamedata/stringtable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gamedata/stringtable.cpp b/src/gamedata/stringtable.cpp index c3700cdf9e..6fd78a7034 100644 --- a/src/gamedata/stringtable.cpp +++ b/src/gamedata/stringtable.cpp @@ -193,7 +193,8 @@ bool FStringTable::readMacros(int lumpnum) bool FStringTable::ParseLanguageCSV(int lumpnum, const TArray &buffer) { - if (memcmp(buffer.Data(), "default,", 8)) return false; + if (buffer.Size() < 11) return false; + if (strnicmp(buffer.Data(), "default,", 8) && strnicmp(buffer.Data(), "identifier,", 11 ) return false; auto data = parseCSV(buffer); int labelcol = -1;