aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-common-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-14 10:46:49 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-23 11:35:11 +0000
commit6d8610d63ecb8e53e14486533a580ea4f37c644c (patch)
treeb0ff63fc5bff14c230bd0c7af14e0a8c74ec25ca /libmm-glib/mm-common-helpers.c
parent8c30a6b6f813114d0cdc6b8a04ae4336c8393d48 (diff)
libmm-glib,common-helpers: ishexstr() fails on empty input string
Diffstat (limited to 'libmm-glib/mm-common-helpers.c')
-rw-r--r--libmm-glib/mm-common-helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
index 30f9f94f..0245fd52 100644
--- a/libmm-glib/mm-common-helpers.c
+++ b/libmm-glib/mm-common-helpers.c
@@ -1738,9 +1738,9 @@ mm_utils_ishexstr (const gchar *hex)
gsize len;
gsize i;
- /* Length not multiple of 2? */
+ /* Empty string or length not multiple of 2? */
len = strlen (hex);
- if (len % 2 != 0)
+ if (len == 0 || (len % 2) != 0)
return FALSE;
for (i = 0; i < len; i++) {