From: Roy Marples Date: Tue, 15 Dec 2015 19:51:49 +0000 (+0000) Subject: copy the configured hostname using the buffer length, X-Git-Tag: v6.10.0~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1128230f7d06ac9fee0fd7d1eee7ee23b87f8b6;p=thirdparty%2Fdhcpcd.git copy the configured hostname using the buffer length, Not the size of the pointer. Thanks to Sem. Fixes [7da8d97fc4]. --- diff --git a/dhcp-common.c b/dhcp-common.c index b3d0a27e..aac24efb 100644 --- a/dhcp-common.c +++ b/dhcp-common.c @@ -61,7 +61,7 @@ dhcp_get_hostname(char *buf, size_t buf_len, const struct if_options *ifo) return NULL; buf[buf_len - 1] = '\0'; } else - strlcpy(buf, ifo->hostname, sizeof(buf)); + strlcpy(buf, ifo->hostname, buf_len); /* Deny sending of these local hostnames */ if (strcmp(buf, "(none)") == 0 ||