GNOME Bugzilla – Bug 702671
Segfault on a gnumeric file with an invalid timestamp
Last modified: 2013-06-19 17:22:21 UTC
Segfault on a gnumeric file with an invalid timestamp. I don't know if this belongs to here or glib's. It seems Gnumeric offers an invalid month which causes a crash in gdatetime.c? But here is the test case with backtrace. Git versions of glib, goffice, gnumeric, libgsf and libxml2. Test case: http://jutaky.com/fuzzing/gnumeric_case_10888_930.gnumeric Program received signal SIGSEGV, Segmentation fault. 0x00007ffff3b2df17 in ymd_to_days (year=2013, month=-2147483647, day=31) at gdatetime.c:366 366 days += days_in_year[0][month - 1]; (gdb) bt
+ Trace 232105
-- Juha Kylmänen Research Assistant, OUSPG
This looks like a glib bug. The documentation for g_date_time_new* clearly says "It not considered a programmer error for the values to this function to be out of range, but in the case that they are, the function will return NULL." so it should not crash. We need to fix this in libgsf to avoid the bug but please also file it against glib.
Note that I do not see crash with glib 2.30.
While this seems to be a problem in glib, we can be a little bit more careful in libgsf. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
I have file bug #702674 against glib with regard to this issue.