Fix breakage of dhcp_lease_time utility.

This commit is contained in:
Simon Kelley
2019-08-14 21:52:50 +01:00
parent ab73a746a0
commit 225accd235
2 changed files with 5 additions and 1 deletions

View File

@@ -83,7 +83,7 @@ static unsigned char *option_find1(unsigned char *p, unsigned char *end, int opt
if (p >= end - 2)
return NULL; /* malformed packet */
opt_len = option_len(p);
if (end - p >= (2 + opt_len))
if (end - p < (2 + opt_len))
return NULL; /* malformed packet */
if (*p == opt && opt_len >= minsize)
return p;