mirror of https://github.com/mirror/busybox.git
udhcpd: fix hostname truncation bug 1663
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>1_17_stable
parent
0a2c793bd6
commit
fde3fb3009
|
@ -60,6 +60,8 @@ struct dyn_lease* FAST_FUNC add_lease(
|
|||
memset(oldest, 0, sizeof(*oldest));
|
||||
if (hostname) {
|
||||
char *p;
|
||||
|
||||
hostname_len++; /* include NUL */
|
||||
if (hostname_len > sizeof(oldest->hostname))
|
||||
hostname_len = sizeof(oldest->hostname);
|
||||
p = safe_strncpy(oldest->hostname, hostname, hostname_len);
|
||||
|
|
Loading…
Reference in New Issue