From c3b7fa941ac47f3ef709ea465f85e5dc86c9d068 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Mon, 22 Feb 2021 10:56:19 -0800 Subject: [PATCH] fix #5048 --- src/util/zstring.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/zstring.cpp b/src/util/zstring.cpp index a296ea092..af0400de0 100644 --- a/src/util/zstring.cpp +++ b/src/util/zstring.cpp @@ -44,6 +44,8 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) { else if (*(s+3+i) == '}') { if (result > 255 && !uses_unicode()) throw default_exception("unicode characters outside of byte range are not supported"); + if (result > unicode_max_char()) + throw default_exception("unicode characters outside of byte range are not supported"); s += 4 + i; return true; } @@ -63,6 +65,8 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) { result = 16*result + d2; result = 16*result + d3; result = 16*result + d4; + if (result > unicode_max_char()) + throw default_exception("unicode characters outside of byte range are not supported"); s += 6; return true; }