From 5403ab4b00bc39a48e9e3e35fa71174a7e20e524 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sat, 8 May 2021 00:21:58 +0200 Subject: [PATCH] Filter out invalid chars to avoid out-of-bounds memory access --- radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp index 6254e0d89..230d3b8f9 100755 --- a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp +++ b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp @@ -856,7 +856,7 @@ coord_t BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_ uint8_t width = drawChar(x, y, font, fontspecs, c, flags); INCREMENT_POS(width + CHAR_SPACING); } - else if (c >= 0x20) { + else if ((c >= 0x20) && (c < CJK_FIRST_LETTER_INDEX + 0x20)) { uint8_t width = drawChar(x, y, font, fontspecs, getMappedChar(c), flags); if ((flags & SPACING_NUMBERS_CONST) && c >= '0' && c <= '9') INCREMENT_POS(getCharWidth('9', fontspecs) + CHAR_SPACING);