[Fontconfig] fontconfig: Branch 'fc-2_4-keithp'

Keith Packard keithp at kemper.freedesktop.org
Sat Sep 2 20:24:01 PDT 2006


 src/fcname.c |    6 ++++++
 1 files changed, 6 insertions(+)

New commits:
diff-tree 04cedae0d5a720662bdc0de3d4cb97f6c77e7d1a (from fb6e30ab3ef74021978d260fb7f2c40a0b5a0b06)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Sat Sep 2 20:23:31 2006 -0700

    Don't segfault when string values can't be parsed as charsets or langsets.
    
    If parsing charsets or langsets fails, return a FcTypeVoid value instead of
    a charset/langset value with a NULL pointer in it (which is invalid).

diff --git a/src/fcname.c b/src/fcname.c
index 6f74bb1..cfc6b31 100644
--- a/src/fcname.c
+++ b/src/fcname.c
@@ -567,6 +567,8 @@ FcNameConvert (FcType type, FcChar8 *str
 	break;
     case FcTypeString:
 	v.u.s = FcStrStaticName(string);
+	if (!v.u.s)
+	    v.type = FcTypeVoid;
 	break;
     case FcTypeBool:
 	if (!FcNameBool (string, &v.u.b))
@@ -581,9 +583,13 @@ FcNameConvert (FcType type, FcChar8 *str
 	break;
     case FcTypeCharSet:
 	v.u.c = FcNameParseCharSet (string);
+	if (!v.u.c)
+	    v.type = FcTypeVoid;
 	break;
     case FcTypeLangSet:
 	v.u.l = FcNameParseLangSet (string);
+	if (!v.u.l)
+	    v.type = FcTypeVoid;
 	break;
     default:
 	break;


More information about the Fontconfig mailing list