projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ad8234
)
udhcpc: fix truncation of last char in client hostnames
author
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 21 Apr 2009 00:41:57 +0000
(
00:41
-0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 21 Apr 2009 00:41:57 +0000
(
00:41
-0000)
networking/udhcp/leases.c
patch
|
blob
|
history
diff --git
a/networking/udhcp/leases.c
b/networking/udhcp/leases.c
index 6e1398d2f62e25de441270ee2ecc5218450db948..e17fb9e3f91e005b094023f637ba5897f0ab1548 100644
(file)
--- a/
networking/udhcp/leases.c
+++ b/
networking/udhcp/leases.c
@@
-63,7
+63,8
@@
struct dhcpOfferedAddr* FAST_FUNC add_lease(
if (oldest) {
oldest->hostname[0] = '\0';
if (hostname) {
- hostname_length = hostname[-1]; /* look at option size byte */
+ /* option size byte, + 1 for NUL */
+ hostname_length = hostname[-1] + 1;
if (hostname_length > sizeof(oldest->hostname))
hostname_length = sizeof(oldest->hostname);
hostname = (uint8_t*) safe_strncpy((char*)oldest->hostname, (char*)hostname, hostname_length);