From fde3fb3009765b273d4d717a7e4609ff7f9461ae Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 2 May 2010 14:17:07 +0200 Subject: udhcpd: fix hostname truncation bug 1663 Signed-off-by: Denys Vlasenko --- networking/udhcp/leases.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c index 4999d8079..fad71ec6c 100644 --- a/networking/udhcp/leases.c +++ b/networking/udhcp/leases.c @@ -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); -- cgit v1.2.3