gtimer: Add overflow checks to g_time_val_from_iso8601()
commitcefa66eb760055ed00e9a45c7e91979c5bb1609a
authorPhilip Withnall <withnall@endlessm.com>
Fri, 3 Aug 2018 13:20:29 +0000 (3 14:20 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Mon, 6 Aug 2018 13:07:29 +0000 (6 14:07 +0100)
tree4b39ea7b2a83c7ba2ce67477e964cfb4a2eda9c6
parentb1fffbffbfe46ba0c15911ea0193bb204bdc6e8b
gtimer: Add overflow checks to g_time_val_from_iso8601()

The code was previously doing a few bits of arithmetic without checking
whether they would overflow, and hence not validating the date/time it
was parsing very strictly.

The parser is now not 100% strict, but should avoid any arithmetic
overflows which would cause an invalid result to be returned even though
g_time_val_from_iso8601() had returned TRUE.

oss-fuzz#9673

Signed-off-by: Philip Withnall <withnall@endlessm.com>
glib/gtimer.c
glib/tests/timer.c