aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-common-helpers.h
diff options
context:
space:
mode:
authorCarlo Lobrano <c.lobrano@gmail.com>2022-04-08 11:46:11 +0200
committerCarlo Lobrano <c.lobrano@gmail.com>2022-04-08 15:41:49 +0200
commitac243f94676695d88e861d225e98ec5bb3c2861e (patch)
tree339f80e309a17e17e707d0716f2bf4e070fae2c1 /libmm-glib/mm-common-helpers.h
parent5c8c1136bd3bad2b542a0b3dc334dbd0686ba10d (diff)
sms: prevent crash if date is out of range
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out of range, and currently mm_new_iso8601_time passes the GDateTime created by those two functions to date_time_format_iso8601 without checking for NULL values, causing a g_date_time_format_iso8601 crash if PDU data is corrupted with wrong date. To prevent this, mm_new_iso8601_time now can return NULL and set a new GError if GDateTime created by g_date_time_new is NULL. Fixes #546
Diffstat (limited to 'libmm-glib/mm-common-helpers.h')
-rw-r--r--libmm-glib/mm-common-helpers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h
index d444012c..490f882d 100644
--- a/libmm-glib/mm-common-helpers.h
+++ b/libmm-glib/mm-common-helpers.h
@@ -216,7 +216,8 @@ gchar *mm_new_iso8601_time (guint year,
guint minute,
guint second,
gboolean have_offset,
- gint offset_minutes);
+ gint offset_minutes,
+ GError **error);
/******************************************************************************/
/* Type checkers and conversion utilities */