]> git.wh0rd.org - fontconfig.git/commitdiff
Fix the underlying cause of the below segfault (must usually call
authorPatrick Lam <plam@MIT.EDU>
Sat, 18 Feb 2006 18:18:07 +0000 (18:18 +0000)
committerPatrick Lam <plam@MIT.EDU>
Sat, 18 Feb 2006 18:18:07 +0000 (18:18 +0000)
    FcDirCacheHasCurrentArch after FcDirCacheValid).

ChangeLog
fc-cache/fc-cache.c
src/fccache.c
src/fcdir.c

index 840a37275ba44eab8a12c616c7f18244067bdb20..737db03e887ead14e369f88920646f16c46a92a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2006-02-18  Patrick Lam  <plam@mit.edu>
+       * fc-cache/fc-cache.c (scanDirs):
+       * src/fccache.c (FcCacheReadDirs):
+       * src/fcdir.c (FcDirScanConfig):
+
+       Fix the underlying cause of the below segfault (must usually
+       call FcDirCacheHasCurrentArch after FcDirCacheValid).
+       
 2006-02-18  Patrick Lam  <plam@mit.edu>
        * src/fccache.c (FcDirCacheHasCurrentArch):
 
-       Fix segfault (reported by fcrozat) caused by incorrect
-       input on cache files.
+       Fix triggering of segfault caused by misreading cache files
+       (reported by fcrozat).
 
 2006-02-17  Patrick Lam  <plam@mit.edu>
        * src/fcint.h  (FC_CACHE_MAGIC):
index b80d4160c020e8d7161aaf6b65d55696eb226f59..ba1ba2bbba7d36b6cac8746f4b5bb4a48d2f6c7c 100644 (file)
@@ -234,6 +234,8 @@ scanDirs (FcStrList *list, FcConfig *config, char *program, FcBool force, FcBool
                printf ("caching, %d fonts, %d dirs\n", 
                        set->nfont, nsubdirs (subdirs));
 
+           /* This is the only reason we can't combine 
+            * Valid w/HasCurrentArch... */
             if (!FcDirCacheValid (dir))
                 if (!FcDirCacheUnlink (dir, config))
                     ret++;
index da4abc7a30073dbb6445bbcd998c14be8ae48760..98f0a88294ea837ac07b4e9dc55af3a8ab0ceae5 100644 (file)
@@ -931,7 +931,9 @@ FcCacheReadDirs (FcConfig * config, FcGlobalCache * cache,
            FcStrSetDestroy (subdirs);
            continue;
        }
-       if (FcDirCacheValid (dir) && FcDirCacheRead (set, subdirs, dir, config))
+       if (FcDirCacheValid (dir) && 
+           FcDirCacheHasCurrentArch (dir) && 
+           FcDirCacheRead (set, subdirs, dir, config))
        {
            /* if an old entry is found in the global cache, disable it */
            if ((d = FcGlobalCacheDirFind (cache, (const char *)dir)) != NULL)
index 771c09b2dd5926f94a55d6acc1c0bf790a9028f2..18cb6cc90e5f12923f085973fea3be82b78f5120 100644 (file)
@@ -142,7 +142,9 @@ FcDirScanConfig (FcFontSet  *set,
        if (cache && FcGlobalCacheReadDir (set, dirs, cache, (char *)dir, config))
            return FcTrue;
 
-       if (FcDirCacheValid (dir) && FcDirCacheRead (set, dirs, dir, config))
+       if (FcDirCacheValid (dir) && 
+           FcDirCacheHasCurrentArch (dir) &&
+           FcDirCacheRead (set, dirs, dir, config))
            return FcTrue;
     }