mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-11 16:18:06 -05:00
Fix blatant segfault in x11_font_has_glyph.
When I cut it in half so I could fetch the XCharStruct for a given character, I forgot that the remaining half should check whether it had got NULL from the XCharStruct finder. Ahem.
This commit is contained in:
parent
ece38fbb21
commit
eb4730e0bf
@ -350,7 +350,7 @@ static int x11_font_has_glyph(XFontStruct *xfs, int byte1, int byte2)
|
||||
* which glyphs _are_ missing.
|
||||
*/
|
||||
const XCharStruct *xcs = x11_char_struct(xfs, byte1, byte2);
|
||||
return (xcs->ascent + xcs->descent > 0 || xcs->width > 0);
|
||||
return xcs && (xcs->ascent + xcs->descent > 0 || xcs->width > 0);
|
||||
}
|
||||
|
||||
static unifont *x11font_create(GtkWidget *widget, const char *name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user