aboutgitcodebugslistschat
path: root/dhcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp.c')
-rw-r--r--dhcp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dhcp.c b/dhcp.c
index de6b133..8183336 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -728,6 +728,9 @@ static void opt_set_dns_search(const struct ctx *c, size_t max_len)
if (n >= max_len)
break;
+ if (opts[119].slen + n > sizeof(opts[119].s))
+ break;
+
memcpy(opts[119].s + opts[119].slen, buf, n);
opts[119].slen += n;
max_len -= n;