NULL pointer dereference due to missing name section.
Hi, there's a NULL pointer dereference while parsing a TTF font file that’s missing the “name” section.
This happens because g_strconcat
here returns NULL if self->face->family_name
is NULL:
When later the height of the SushiFontWidget
is checked by gtk_widget_get_preferred_height_and_baseline_for_width
:
This strlen
operates on NULL:
To reproduce, given any TTF file, install https://github.com/fonttools/fonttools and then:
ttx -x name /path/to/source.ttf -o nameless.ttf
gnome-font-viewer nameless.ttf