aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bootp.c b/bootp.c
index baa6380..810da0c 100644
--- a/bootp.c
+++ b/bootp.c
@@ -129,6 +129,9 @@ static void dhcp_decode(const struct bootp_t *bp, int *pmsg_type,
if (p >= p_end)
break;
len = *p++;
+ if (p + len > p_end) {
+ break;
+ }
DPRINTF("dhcp: tag=%d len=%d\n", tag, len);
switch (tag) {