From 8c844291b78ee634a0ce2b826d7d8f2cff87c604 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 10 Aug 2018 10:43:37 +0100 Subject: [PATCH] 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 --- glib/gtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gtimer.c b/glib/gtimer.c index 76da128c8..201225523 100644 --- a/glib/gtimer.c +++ b/glib/gtimer.c @@ -497,7 +497,7 @@ g_time_val_from_iso8601 (const gchar *iso_date, 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 {