Bug 35

Summary: Segfault in fc-cache
Product: fontconfig Reporter: Owen Taylor <otaylor>
Component: fc-cacheAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: 2_1   
Hardware: x86 (IA32)   
OS: Linux (All)   
i915 platform: i915 features:

Description Owen Taylor 2003-02-24 08:10:12 UTC
fc-cache segfaults within FcDirScan() because FcDirScan()
       if (FcDirCacheReadDir (set, dirs, dir))
          FcGlobalCacheReferenceSubdir (cache, dir);
          return FcTrue;

But cache can be NULL. Adding a if (cache) before
calling ReferenceSubdir() looks right and tests to fix
the problem.

[ Reproduction:

  touch /usr/share/fonts/ja/Default
  touch /usr/share/fonts/ja
  touch /usr/share/fonts
  fc-cache /usr/share/fonts/ja

  Probably can be made a lot more minimal, but the fix was obvious
Comment 1 Keith Packard 2003-02-24 08:52:11 UTC
Oops.  Forgot to commit the fix for this...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.