]> git.wh0rd.org Git - fontconfig.git/commitdiff
Don't crash on non-existant directories in global cache.
authorPatrick Lam <plam@MIT.EDU>
Thu, 26 Jan 2006 16:11:41 +0000 (16:11 +0000)
committerPatrick Lam <plam@MIT.EDU>
Thu, 26 Jan 2006 16:11:41 +0000 (16:11 +0000)
reviewed by: plam

ChangeLog
src/fccache.c

index 328b0fb4d3e2da78a47c96301ef54838289b1eab..32f20e40eb638fd1f7180225154058e01054786f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-26  Mike Fabian  <mfabian@suse.de>
+       reviewed by: plam
+       
+       * src/fcacache.c (FcGlobalCacheReadDir):
+
+       Don't crash on non-existant directories in global cache.
+
 2006-01-26  Patirck Lam  <plam@mit.edu>
        * src/fccache.c (FcGlobalCacheSave, FcDirCacheWrite):
        * src/fccfg.c (FcConfigAddFontDirSubdirs, FcConfigNormalizeFontDir):
index 349bc9ab500a69a12e32d5b107af1afbca873417..a687483bc9fdcdca1630d9433e8cbc75112ff2dc 100644 (file)
@@ -304,7 +304,9 @@ FcGlobalCacheReadDir (FcFontSet *set, FcStrSet *dirs, FcGlobalCache * cache, con
     if (cache->fd == -1)
        return FcFalse;
 
-    dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir);
+    if (!(dir = (char *)FcConfigNormalizeFontDir (config, (FcChar8 *)dir)))
+       return FcFalse; /* non-existing directory */
+
     for (d = cache->dirs; d; d = d->next)
     {
        if (strncmp (d->name, dir, strlen(dir)) == 0)