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-dhclient-utils.c | |
| parent | afcd268ea7b1149fbfb66bce4eca659b675da0a2 (diff) | |
New upstream version 1.10.4 upstream/1.10.4
Diffstat (limited to 'src/dhcp/nm-dhcp-dhclient-utils.c')
| -rw-r--r-- | src/dhcp/nm-dhcp-dhclient-utils.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 */ |