Patch: avoid crashes is config files contain junk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


If ~/.fonts.conf contains:

  <edit mode="assign_replace" name="spacing">

fontconfig crashes:

    mfabian@magellan:~$ fc-match sans
    Fontconfig error: "~/.fonts.conf", line 46: "mono": not a valid integer
    セグメンテーション違反です (core dumped)

Of course the above is nonsense, “mono” is no valid integer indeed.

But I think nevertheless fontconfig should not crash in that case.

A patch is attached. 

Mike FABIAN   <mfabian@xxxxxxx>
I � Unicode

diff -ru fontconfig-2.4.2.orig/src/fcxml.c fontconfig-2.4.2/src/fcxml.c
--- fontconfig-2.4.2.orig/src/fcxml.c	2006-12-02 22:54:03.000000000 +0100
+++ fontconfig-2.4.2/src/fcxml.c	2007-02-21 17:13:37.000000000 +0100
@@ -557,6 +557,9 @@
     const FcObjectType	*o;
     const FcConstant	*c;
+    if (!expr)
+	return;
     switch (expr->op) {
     case FcOpInteger:
Fontconfig mailing list

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux