aboutsummaryrefslogtreecommitdiffstats
path: root/package/busybox/patches/000-upstream-dhcpd.patch
blob: eef33f80de74349a89a35e203edf6ca8e612e7d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- a/networking/udhcp/leases.c
+++ b/networking/udhcp/leases.c
@@ -64,6 +64,8 @@ struct dyn_lease* FAST_FUNC add_lease(
 		oldest->hostname[0] = '\0';
 		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);