<div dir="ltr">Thanks. but how often does it happen? I think it's only when the memory allocation failed though.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 5, 2015 at 10:36 PM, Matt Breedlove <span dir="ltr"><<a href="mailto:breedlove.matt@gmail.com" target="_blank">breedlove.matt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:12.8000001907349px">Beginning with version 2.11.91 up to trunk:</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">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.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">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.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">mingw-w64 / gcc 4.92 / Windows 8.1 x64<br></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><br></div><div><div><span style="font-size:12.8000001907349px">diff --git a/src/fcinit.c b/src/fcinit.c</span></div><div><span style="font-size:12.8000001907349px">index db62c21..1315a52 100644</span></div><div><span style="font-size:12.8000001907349px">--- a/src/fcinit.c</span></div><div><span style="font-size:12.8000001907349px">+++ b/src/fcinit.c</span></div><div><span style="font-size:12.8000001907349px">@@ -209,6 +209,9 @@ FcInitBringUptoDate (void)</span></div><div><span style="font-size:12.8000001907349px">     FcConfig   *config = FcConfigGetCurrent ();</span></div><div><span style="font-size:12.8000001907349px">     time_t     now;</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">+    if (!config)</span></div><div><span style="font-size:12.8000001907349px">+        return FcFalse;</span></div><div><span style="font-size:12.8000001907349px">+</span></div><div><span style="font-size:12.8000001907349px">     /*</span></div><div><span style="font-size:12.8000001907349px">      * rescanInterval == 0 disables automatic up to date</span></div><div><span style="font-size:12.8000001907349px">      */</span></div><span class="HOEnZb"><font color="#888888"><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Matt Breedlove</div></font></span></div></div>
<br>_______________________________________________<br>
Fontconfig mailing list<br>
<a href="mailto:Fontconfig@lists.freedesktop.org">Fontconfig@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/fontconfig" target="_blank">http://lists.freedesktop.org/mailman/listinfo/fontconfig</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Akira TAGOH</div>
</div>