]> git.wh0rd.org Git - fontconfig.git/commitdiff
Fix segfault when consuming zero-length caches in fc-cat (which has no
authorPatrick Lam <plam@MIT.EDU>
Sun, 15 Jan 2006 05:31:58 +0000 (05:31 +0000)
committerPatrick Lam <plam@MIT.EDU>
Sun, 15 Jan 2006 05:31:58 +0000 (05:31 +0000)
    config, so FcConfigAddFontDir shouldn't be called.)

ChangeLog
src/fccache.c

index a09abf5483839a0ecd9ee6cd9571168ff82a9b21..8bcf9fb64b8236712ea342df0b6f176353ccf241 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-14  Patirck Lam  <plam@mit.edu>
+       * src/fccache.c (FcDirCacheConsume):
+
+       Fix segfault when consuming zero-length caches in fc-cat
+       (which has no config, so FcConfigAddFontDir shouldn't be called.)
+
 2006-01-14  Patrick Lam  <plam@mit.edu>
        * fc-cache/fc-cache.c (scanDirs):
        * fontconfig/fontconfig.h:
index b36dbd253087f504a1e3310178e0725b20ac3d58..10e65ddc0d2ce68546cc8a8b543f0f538edd8385 100644 (file)
@@ -978,7 +978,8 @@ FcDirCacheConsume (int fd, const char * dir, FcFontSet *set, FcConfig *config)
     {
        pos = FcCacheNextOffset (lseek(fd, 0, SEEK_CUR));
        lseek (fd, pos, SEEK_SET);
-       FcConfigAddFontDir (config, (FcChar8 *)dir);
+       if (config)
+           FcConfigAddFontDir (config, (FcChar8 *)dir);
        return FcTrue;
     }