ref: dd0ccdc3d3c74fcb51b0f77b6bcefae58d10fc5c
parent: 12ef831fc314518bff45278008a568608501a8e4
author: Alexei Podtelezhnikov <apodtele@gmail.com>
date: Tue Sep 28 18:57:58 EDT 2021
* src/winfonts/winfnt.c (FNT_Face_Init): Correct reallocation.
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -897,9 +897,10 @@
font->family_name[family_size] = '\0';
- if ( FT_REALLOC( font->family_name,
- family_size,
- ft_strlen( font->family_name ) + 1 ) )
+ /* shrink it to the actual length */
+ if ( FT_QREALLOC( font->family_name,
+ family_size + 1,
+ ft_strlen( font->family_name ) + 1 ) )
goto Fail;
root->family_name = font->family_name;