]> git.wh0rd.org Git - fontconfig.git/commitdiff
Don't crash if config is null (Coverity defect #984).
authorPatrick Lam <plam@MIT.EDU>
Wed, 12 Apr 2006 02:38:28 +0000 (02:38 +0000)
committerPatrick Lam <plam@MIT.EDU>
Wed, 12 Apr 2006 02:38:28 +0000 (02:38 +0000)
ChangeLog
src/fccache.c

index 5647a49547403a98aff144333fe672d078fdaa59..a5eec3fa913fc1bdc745bec8bc26f417cdc2e98b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,23 @@
+2006-04-11  Patrick Lam  <plam@mit.edu>
+       * src/fccache.c (FcGlobalCacheReadDir):
+
+       Don't crash if config is null (Coverity defect #984).
+
 2006-04-11  Frederic Crozat  <fcrozat@mandriva.com>
        reviewed by: plam
 
-       * src/fccharset.c: (FcCharSetPutLeaf):
-       * src/fclang.c: (FcNameUnparseLangSet):
+       * src/fccharset.c (FcCharSetPutLeaf):
+       * src/fclang.c (FcNameUnparseLangSet):
 
        Missing bits from previous patches.
 
        * src/fccharset.c (FcCharSetSubtractCount):
        Remove extra semi-colon.
 
-       * src/fccfg.c: (FcConfigBuildFonts):
+       * src/fccfg.c (FcConfigBuildFonts):
        Fix memory leak in error case (Coverity defects #776, #985).
 
-       * src/fcxml.c: (FcPopBinary, FcParsePatelt, FcParsePattern):
+       * src/fcxml.c (FcPopBinary, FcParsePatelt, FcParsePattern):
        Fix memory leaks (Coverity defects #779, #781) 
        and memory use after free (Coverity defect #780).
 
index 23c37f12ba8146f0475da1d7fc046ed5f41f93ff..58f925db8db6ef5de91802b50f55c2bd09e31fe1 100644 (file)
@@ -320,8 +320,9 @@ FcGlobalCacheReadDir (FcFontSet *set, FcStrSet *dirs, FcGlobalCache * cache, con
     if (cache->fd == -1)
        return FcFalse;
 
-    if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
-       return FcFalse; /* non-existing directory */
+    if (config)
+       if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
+           return FcFalse; /* non-existing directory */
 
     for (d = cache->dirs; d; d = d->next)
     {