[PATCH xfd] Fix SEGV when XftFontOpenName() returns NULL.

Egbert Eich eich at freedesktop.org
Thu Jan 3 10:51:39 PST 2013


From: Andreas Schwab <schwab at redhat.com>

The semantics of a callback set with XtSetTypeConverter() is to return
False only if there is no conversion at all.
In this case the converstion string is copied verbatim to the target.
Since the from and to types differ this doesn't make sense here at all.
Instead the target value needs to be set to NULL and the return needs
to be True.

Signed-off-by: Egbert Eich <eich at freedesktop.org>
---
 grid.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/grid.c b/grid.c
index e1f134d..49f7693 100644
--- a/grid.c
+++ b/grid.c
@@ -542,10 +542,7 @@ XmuCvtStringToXftFont(Display *dpy,
 				XScreenNumberOfScreen (screen),
 				name);
 	if (!font)
-	{
 	    XtDisplayStringConversionWarning(dpy, (char *) fromVal->addr, XtRXftFont);
-	    return False;
-	}
     }
     donestr (XftFont *, font, XtRXftFont);
 }
-- 
1.7.7



More information about the xorg-devel mailing list