From ebfe0b6f485ee34c7c37f62aa6aeefca2689d433 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 31 Jul 2021 11:56:31 +0200 Subject: [PATCH] exp_parser:: crash on unknown values starting with capital letters and _ --- util.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util.cpp b/util.cpp index c48581d4..fdd51e1c 100644 --- a/util.cpp +++ b/util.cpp @@ -340,6 +340,8 @@ cld exp_parser::parse(int prio) { else if(number == "mousez") res = cld(mousex - current_display->xcenter, mousey - current_display->ycenter) / cld(current_display->radius, 0); else if(number == "shot") res = inHighQual ? 1 : 0; else if(number[0] >= 'a' && number[0] <= 'z') throw hr_parse_exception("unknown value: " + number); + else if(number[0] >= 'A' && number[0] <= 'Z') throw hr_parse_exception("unknown value: " + number); + else if(number[0] == '_') throw hr_parse_exception("unknown value: " + number); else { std::stringstream ss; res = 0; ss << number; ss >> res; } } while(true) {