about summary refs log tree commit diff
path: root/src/dhcp/nm-dhcp-utils.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-02-07 02:40:03 +0100
committerMichael Biebl <biebl@debian.org>2018-02-07 02:40:03 +0100
commit77dfac263f463c1cdb8afb9b8c79a4e83bf08cd8 (patch)
treee5288440b22e159a601450c2e5d40b013bdb4aa0 /src/dhcp/nm-dhcp-utils.c
parent3d9525cb641ac53c6d36bf5312710c22ae4bd926 (diff)
parent50f6b47074e01dffb8dc536c0a20961dcf28ae9b (diff)
Update upstream source from tag 'upstream/1.10.4'
Update to upstream version '1.10.4'
with Debian dir d2c0f877c591b3125f4e0cfcc711c04669d8d62b
Diffstat (limited to 'src/dhcp/nm-dhcp-utils.c')
-rw-r--r--src/dhcp/nm-dhcp-utils.c9
1 files changed, 8 insertions, 1 deletions
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);