test-calendarspec: add the test case from oss-fuzz 6886
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 23:15:15 +0000 (00:15 +0100)
Before the fix 55a30fd4e8 in this would crash in calendarspec_from_time_t().

src/test/test-calendarspec.c

index 1a95b60..cce305e 100644 (file)
@@ -259,6 +259,7 @@ int main(int argc, char* argv[]) {
         assert_se(calendar_spec_from_string("00:00/60", &c) < 0);
         assert_se(calendar_spec_from_string("00:00:2300", &c) < 0);
         assert_se(calendar_spec_from_string("00:00:18446744073709551615", &c) < 0);
+        assert_se(calendar_spec_from_string("@88588582097858858", &c) == -ERANGE);
 
         test_timestamp();
         test_hourly_bug_4031();