Bug 35 - Segfault in fc-cache
Summary: Segfault in fc-cache
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: fc-cache (show other bugs)
Version: 2_1
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Keith Packard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-24 08:10 UTC by Owen Taylor
Modified: 2003-02-23 13:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Owen Taylor 2003-02-24 08:10:12 UTC
fc-cache segfaults within FcDirScan() because FcDirScan()
does:
       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-list
  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.