fixed potential buffer overflow for dynamically changed fonts
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 12 Oct 2024 17:49:53 +0000 (19:49 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 12 Oct 2024 17:49:53 +0000 (19:49 +0200)
src/libgame/text.c

index b028f9e296398a8b505e97fce56741e511683dfa..87cd7dc22a3eba5543fcfe5f591d50402b6c91df 100644 (file)
@@ -566,7 +566,7 @@ static int DrawTextBufferExt(int x, int y, char *text_buffer, int base_font_nr,
                             boolean centered, boolean parse_comments,
                             boolean is_text_area)
 {
-  char buffer[line_length + 1];
+  char buffer[MAX_OUTPUT_LINESIZE + 1];
   int buffer_len;
   int font_nr = base_font_nr;
   int font_width = getFontWidth(font_nr);