From 10b6d0fbea271d28e7d032cc4dc631fc4e3e9f47 Mon Sep 17 00:00:00 2001 From: MrDave Date: Wed, 21 Jan 2026 22:28:47 -0800 Subject: [PATCH] Check draw array bounds. Closes #1935 --- src/draw.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/draw.cpp b/src/draw.cpp index 048ab1db..a7e36e28 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -1101,6 +1101,9 @@ int cls_draw::textn(u_char *image for (pos = 0; pos < len; pos++) { int pos_check = (int)text[pos]; + if ((pos_check <0) || (pos_check >126)) { + pos_check = 45; /* Use a - for non ascii characters*/ + } char_ptr = char_arr_ptr[pos_check]; for (y = 0; y < 8 * factor; y++) {