basic/calendarspec: fix assert crash when year is too large in calendarspec_from_time_t()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 13 Mar 2018 11:51:08 +0000 (12:51 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Mar 2018 15:50:09 +0000 (16:50 +0100)
commit55a30fd4e832891604b1775cbfb06a85d52d9424
treee15485475fb7a06eeb79cf9a4ef593b6cdbfc7c1
parent20d52ab60e7ba40f7cf23c148bcead8bd05bea3a
basic/calendarspec: fix assert crash when year is too large in calendarspec_from_time_t()

gmtime_r() will return NULL in that case, and we would crash.

I committed the reproducer case in fuzz-regressions/, even though we don't have
ubsan hooked up yet. Let's add it anyway in case it is useful in the future. We
actually crash anyway when compiled with asserts, so this can be easily
reproduced without ubsan.

oss-fuzz #6886.
src/basic/calendarspec.c
test/fuzz-regressions/fuzz-unit-file/oss-fuzz-6886 [new file with mode: 0644]
test/fuzz-regressions/meson.build