From c68940712d15f3fd048a94d6441d241f3c08fe5f Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 30 Jul 2020 16:41:46 +0200 Subject: [PATCH] prevent writing beyond end of buffer --- src/frontend/postsc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/postsc.c b/src/frontend/postsc.c index 26221596f..b7741feca 100644 --- a/src/frontend/postsc.c +++ b/src/frontend/postsc.c @@ -410,7 +410,8 @@ int PS_Text(const char *text_in, int x, int y, int angle) char *text; { const size_t n_char_text = strlen(text_in); - text = TMALLOC(char, n_char_text); + const size_t n_char_textp = n_char_text + 2; + text = TMALLOC(char, n_char_textp); utf8_to_latin9(text, text_in, n_char_text); } #endif