зеркало из https://github.com/github/putty.git
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:
Родитель
ece38fbb21
Коммит
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче