diff options
| author | Michael Biebl <biebl@debian.org> | 2018-02-07 02:39:23 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-02-07 02:39:23 +0100 |
| commit | 50f6b47074e01dffb8dc536c0a20961dcf28ae9b (patch) | |
| tree | b4bd771d78ebe38661b8c4ec8b9a8e0eb8261eb5 /src/dhcp/nm-dhcp-utils.c | |
| parent | afcd268ea7b1149fbfb66bce4eca659b675da0a2 (diff) | |
New upstream version 1.10.4 upstream/1.10.4
Diffstat (limited to 'src/dhcp/nm-dhcp-utils.c')
| -rw-r--r-- | src/dhcp/nm-dhcp-utils.c | 9 |
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); |