| Summary: | dumplease not show end symbol at client hostname | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Evgeniy Manachkin <sfstudio> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.16.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | patch to fix cut end symbol at hostname in udhcpd lease file | ||
|
Description
Evgeniy Manachkin
2010-04-29 21:09:48 UTC
Im`m copy lease file to PC and view in hexedit, hostname = hostname printed dumpleases. And dumpleases and in lease file client hostname dom`t include one symbol at end name. Any ideas ? leases.c ? udhcpd.c ??? This patch fix it:
--- leases.c.orig 2010-04-30 22:12:47.000000000 +0700
+++ leases.c 2010-04-30 22:05:18.143207528 +0700
@@ -66,7 +66,7 @@
char *p;
if (hostname_len > sizeof(oldest->hostname))
hostname_len = sizeof(oldest->hostname);
- p = safe_strncpy(oldest->hostname, hostname, hostname_len);
+ p = safe_strncpy(oldest->hostname, hostname, hostname_len + 1);
/* sanitization (s/non-ASCII/^/g) */
while (*p) {
if (*p < ' ' || *p > 126)
Created attachment 1609 [details]
patch to fix cut end symbol at hostname in udhcpd lease file
what will happen if hostname_len == sizeof(oldest->hostname) ?? (In reply to comment #4) > what will happen if hostname_len == sizeof(oldest->hostname) ?? dumpleases show garbage (rt3052 mips LE) or segfault on dhcp client send hotsname (rtl8672 mips BE) (In reply to comment #5) > (In reply to comment #4) > > what will happen if hostname_len == sizeof(oldest->hostname) ?? > dumpleases show garbage (rt3052 mips LE) or segfault on dhcp client send > hotsname (rtl8672 mips BE) Is it an answer to my question? |