From 50f6b47074e01dffb8dc536c0a20961dcf28ae9b Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 7 Feb 2018 02:39:23 +0100 Subject: New upstream version 1.10.4 --- src/dhcp/nm-dhcp-utils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/dhcp/nm-dhcp-utils.c') diff --git a/src/dhcp/nm-dhcp-utils.c b/src/dhcp/nm-dhcp-utils.c index 4b2d57b9..50ca2abe 100644 --- a/src/dhcp/nm-dhcp-utils.c +++ b/src/dhcp/nm-dhcp-utils.c @@ -750,8 +750,15 @@ nm_dhcp_utils_client_id_string_to_bytes (const char *client_id) g_return_val_if_fail (client_id && client_id[0], NULL); /* Try as hex encoded */ - if (strchr (client_id, ':')) + if (strchr (client_id, ':')) { bytes = nm_utils_hexstr2bin (client_id); + + /* the result must be at least two bytes long, + * because @client_id contains a delimiter + * but nm_utils_hexstr2bin() does not allow + * leading nor trailing delimiters. */ + nm_assert (!bytes || g_bytes_get_size (bytes) >= 2); + } if (!bytes) { /* Fall back to string */ len = strlen (client_id); -- cgit 1.3.0-6-gf8a5