1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Fixes segfault in dtprintinfo when used UTF-8 locale, bug was caused by unchecked return value of XmeRenderTableGetDefaultFont()

This commit is contained in:
Eugene Doudine 2014-02-21 13:52:25 +02:00 committed by Jon Trulson
parent 4c56765da3
commit 23e217b329
2 changed files with 9 additions and 4 deletions

View file

@ -96,7 +96,7 @@ static XrmOptionDescRec options[] =
}; };
extern "C" { extern "C" {
extern void XmeRenderTableGetDefaultFont(XmFontList, XFontStruct **); extern Boolean XmeRenderTableGetDefaultFont(XmFontList, XFontStruct **);
} }
Application::Application(char *name, Application::Application(char *name,
@ -151,10 +151,13 @@ Application::Application(char *name,
{ {
XmFontType _type_return; XmFontType _type_return;
fs = (XFontStruct *)XmFontListEntryGetFont(entry, &_type_return); fs = (XFontStruct *)XmFontListEntryGetFont(entry, &_type_return);
if (_type_return != XmFONT_IS_FONT) if (_type_return != XmFONT_IS_FONT) {
XmeRenderTableGetDefaultFont(userFont, &fs); XmeRenderTableGetDefaultFont(userFont, &fs);
}
if (fs) {
font = fs->fid; font = fs->fid;
} }
}
XmFontListFreeFontContext(context); XmFontListFreeFontContext(context);
} }
} }

View file

@ -93,7 +93,9 @@ DtDND::DtDND(MotifUI *_obj, DNDCallback _dndCB, boolean _can_drop_on_root)
gc = XCreateGC(tmp->display, tmp_pixmap, 0, NULL); gc = XCreateGC(tmp->display, tmp_pixmap, 0, NULL);
tmp_pixmap = XCreatePixmap(tmp->display, tmp->root, 1, 1, 1); tmp_pixmap = XCreatePixmap(tmp->display, tmp->root, 1, 1, 1);
gc_mask = XCreateGC(tmp->display, tmp_pixmap, 0, NULL); gc_mask = XCreateGC(tmp->display, tmp_pixmap, 0, NULL);
if (tmp->font) {
XSetFont(tmp->display, gc, tmp->font); XSetFont(tmp->display, gc, tmp->font);
}
FirstTime = false; FirstTime = false;
} }