gtimer: Ensure arithmetic is correctly signed for ISO 8601 parsing
When calculating the value of a timezone offset, ensure that any offsets
done with negative numbers are done in a signed integer.
oss-fuzz#9815
Signed-off-by: Philip Withnall <withnall@endlessm.com>
diff --git a/glib/gtimer.c b/glib/gtimer.c
index 76da128..2012255 100644
--- a/glib/gtimer.c
+++ b/glib/gtimer.c
@@ -497,7 +497,7 @@
if (min > 59)
return FALSE;
- time_->tv_sec = mktime_utc (&tm) + (time_t) (60 * (60 * hour + min) * sign);
+ time_->tv_sec = mktime_utc (&tm) + (time_t) (60 * (gint64) (60 * hour + min) * sign);
}
else
{