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-dhclient-utils.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/dhcp/nm-dhcp-dhclient-utils.c') diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c index e63e6a86..4df90d76 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/dhcp/nm-dhcp-dhclient-utils.c @@ -178,7 +178,7 @@ read_client_id (const char *str) gs_free char *s = NULL; char *p; - g_assert (!strncmp (str, CLIENTID_TAG, NM_STRLEN (CLIENTID_TAG))); + nm_assert (!strncmp (str, CLIENTID_TAG, NM_STRLEN (CLIENTID_TAG))); str += NM_STRLEN (CLIENTID_TAG); while (g_ascii_isspace (*str)) @@ -198,6 +198,9 @@ read_client_id (const char *str) if (s[strlen (s) - 1] == ';') s[strlen (s) - 1] = '\0'; + if (!s[0]) + return NULL; + return nm_dhcp_utils_client_id_string_to_bytes (s); } @@ -329,8 +332,7 @@ nm_dhcp_dhclient_create_config (const char *interface, continue; /* Otherwise capture and return the existing client id */ - if (out_new_client_id) - *out_new_client_id = read_client_id (p); + NM_SET_OUT (out_new_client_id, read_client_id (p)); } /* Override config file hostname and use one from the connection */ -- cgit 1.3.0-6-gf8a5