GNOME Bugzilla – Bug 751922
SIGABRT from gtestutils.c:2356 on a fuzzed xls file
Last modified: 2015-07-17 13:22:32 UTC
Git versions of glib, goffice, gnumeric, libgsf and libxml2. Test case: http://jutaky.com/fuzzing/gnumeric_case_005-gtestutils.c.2356.xls $ ssconvert gnumeric_case_005-gtestutils.c.2356.xls /tmp/out.gnumeric Program received signal SIGABRT, Aborted. 0x00007fffefc47528 in raise () from /usr/lib/libc.so.6 (gdb) bt
+ Trace 235229
-- Juha Kylmänen
I don't see the link to gtestutils, the crash occurs in value_compare_real() because one at least of the values is NULL:
+ Trace 235232
Not sure how it should be fixed, probably returning an error when a or b is NULL.
I think the real issue is that we should never get to value_compare_real with NULL values.
I was wrong, Value_compare_real is clearly trying to handle the NULL values by translating it into VALUE_EMPTY.
To me this looks like a logic error. We have: switch (PAIR (ta,tb)) { case CPAIR (VALUE_EMPTY,VALUE_EMPTY): g_assert_not_reached(); /* Should have hit trivial case. */ return IS_EQUAL; The trivial case referred to is if (a == b) return IS_EQUAL; If we have a NULL value and a non-null value that is VALUE_EMPTY, I don't see why we would always hit the 'trivial case", since just after testing for the trivial case we have: ta = VALUE_IS_EMPTY (a) ? VALUE_EMPTY : a->v_any.type; tb = VALUE_IS_EMPTY (b) ? VALUE_EMPTY : b->v_any.type; I think we should just remove the g_assert_not_reached(). Am I missing something?
Andreas: I think you are right. This code, in its current form, isn't terribly old, so we probably just haven't exercised it enough.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
*** Bug 749907 has been marked as a duplicate of this bug. ***