gdatetime: Track timezone length as an unsigned size_t

It’s guaranteed to be in (0, length] by the calculations above.

This avoids the possibility of integer overflow through `gssize` not
being as big as `size_t`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2025-02-18 16:55:18 +00:00
parent 2fa1e18361
commit 0b225e7cd8
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -1394,7 +1394,8 @@ parse_iso8601_date (const gchar *text, gsize length,
static GTimeZone *
parse_iso8601_timezone (const gchar *text, gsize length, size_t *tz_offset)
{
gint i, tz_length, offset_hours, offset_minutes;
size_t tz_length;
gint i, offset_hours, offset_minutes;
gint offset_sign = 1;
GTimeZone *tz;