From 5286a2d9ae659689888e39aea2869d59175e89b8 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 14 Feb 2021 12:32:48 +0100 Subject: [PATCH] Added some safety checks to thingy file parser --- source/helpers/encoding_file.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/helpers/encoding_file.cpp b/source/helpers/encoding_file.cpp index 95a71f747..3f252a77d 100644 --- a/source/helpers/encoding_file.cpp +++ b/source/helpers/encoding_file.cpp @@ -45,10 +45,13 @@ namespace hex { hex::trim(from); hex::trim(to); + if (from.empty()) continue; if (to.empty()) to = " "; } auto fromBytes = hex::parseByteString(from); + if (fromBytes.empty()) continue; + if (!this->m_mapping.contains(fromBytes.size())) this->m_mapping.insert({ fromBytes.size(), { } }); this->m_mapping[fromBytes.size()].insert({ fromBytes, to });