prevent writing beyond end of buffer

This commit is contained in:
Holger Vogt 2020-07-30 16:41:46 +02:00
parent 02222be165
commit c68940712d
1 changed files with 2 additions and 1 deletions

View File

@ -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