[Fontconfig] Segfault within fc-list when not provided with a valid configuration

Akira TAGOH akira at tagoh.org
Thu Mar 5 18:02:51 PST 2015


Thanks. but how often does it happen? I think it's only when the memory
allocation failed though.

On Thu, Mar 5, 2015 at 10:36 PM, Matt Breedlove <breedlove.matt at gmail.com>
wrote:

> Beginning with version 2.11.91 up to trunk:
>
> In fcinit.c, the FcInitBringUptoDate function doesn't properly validate
> the return value for FcConfigGetCurrent() leading to a segfault when
> attempting to reference config->rescanInterval.
>
> fc-list suffers from this problem and crashes as a result when not
> provided with a valid fontconfig file.  Versions prior to 2.11.91 don't
> exhibit the same behavior.
>
> mingw-w64 / gcc 4.92 / Windows 8.1 x64
>
>
> diff --git a/src/fcinit.c b/src/fcinit.c
> index db62c21..1315a52 100644
> --- a/src/fcinit.c
> +++ b/src/fcinit.c
> @@ -209,6 +209,9 @@ FcInitBringUptoDate (void)
>      FcConfig   *config = FcConfigGetCurrent ();
>      time_t     now;
>
> +    if (!config)
> +        return FcFalse;
> +
>      /*
>       * rescanInterval == 0 disables automatic up to date
>       */
>
> Matt Breedlove
>
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fontconfig
>
>


-- 
Akira TAGOH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20150306/3cae7a86/attachment.html>


More information about the Fontconfig mailing list