summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-02 12:17:07 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-05-02 12:17:07 (GMT)
commitfde3fb3009765b273d4d717a7e4609ff7f9461ae (patch)
tree9435f21a7af190c7140c4ddb36d49cb13dfeb138
parent0a2c793bd61540629d5686adb5afd2ada19d624f (diff)
downloadbusybox-fde3fb3009765b273d4d717a7e4609ff7f9461ae.tar.gz
busybox-fde3fb3009765b273d4d717a7e4609ff7f9461ae.tar.bz2
udhcpd: fix hostname truncation bug 1663
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/udhcp/leases.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c
index 4999d80..fad71ec 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);