diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-02 14:17:07 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-02 14:17:07 +0200 |
commit | fde3fb3009765b273d4d717a7e4609ff7f9461ae (patch) | |
tree | 9435f21a7af190c7140c4ddb36d49cb13dfeb138 | |
parent | 0a2c793bd61540629d5686adb5afd2ada19d624f (diff) | |
download | busybox-w32-fde3fb3009765b273d4d717a7e4609ff7f9461ae.tar.gz busybox-w32-fde3fb3009765b273d4d717a7e4609ff7f9461ae.tar.bz2 busybox-w32-fde3fb3009765b273d4d717a7e4609ff7f9461ae.zip |
udhcpd: fix hostname truncation bug 1663
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/udhcp/leases.c | 2 |
1 files changed, 2 insertions, 0 deletions
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( | |||
60 | memset(oldest, 0, sizeof(*oldest)); | 60 | memset(oldest, 0, sizeof(*oldest)); |
61 | if (hostname) { | 61 | if (hostname) { |
62 | char *p; | 62 | char *p; |
63 | |||
64 | hostname_len++; /* include NUL */ | ||
63 | if (hostname_len > sizeof(oldest->hostname)) | 65 | if (hostname_len > sizeof(oldest->hostname)) |
64 | hostname_len = sizeof(oldest->hostname); | 66 | hostname_len = sizeof(oldest->hostname); |
65 | p = safe_strncpy(oldest->hostname, hostname, hostname_len); | 67 | p = safe_strncpy(oldest->hostname, hostname, hostname_len); |