From: Patrick Lam Date: Thu, 26 Jan 2006 16:11:41 +0000 (+0000) Subject: Don't crash on non-existant directories in global cache. X-Git-Tag: fc-2_3_94~59 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4073203deb00cb1497f7cc8c1a7de25534070d2c;p=fontconfig.git Don't crash on non-existant directories in global cache. reviewed by: plam --- diff --git a/ChangeLog b/ChangeLog index 328b0fb..32f20e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-01-26 Mike Fabian + reviewed by: plam + + * src/fcacache.c (FcGlobalCacheReadDir): + + Don't crash on non-existant directories in global cache. + 2006-01-26 Patirck Lam * src/fccache.c (FcGlobalCacheSave, FcDirCacheWrite): * src/fccfg.c (FcConfigAddFontDirSubdirs, FcConfigNormalizeFontDir): diff --git a/src/fccache.c b/src/fccache.c index 349bc9a..a687483 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -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)