Skip to content

Commit 9b29b3b

Browse files
committed
fix use-after-free in registerFont
set_family_static requires that family not be freed until desc is freed. set_family copies the string.
1 parent b809150 commit 9b29b3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/register_font.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ get_pango_font_description(unsigned char* filepath) {
303303
return NULL;
304304
}
305305

306-
pango_font_description_set_family_static(desc, family);
306+
pango_font_description_set_family(desc, family);
307307
free(family);
308308
pango_font_description_set_weight(desc, get_pango_weight(table->usWeightClass));
309309
pango_font_description_set_stretch(desc, get_pango_stretch(table->usWidthClass));

0 commit comments

Comments
 (0)