Misc code cleanups arising from Google analysis.

No security impleications or CVEs.
This commit is contained in:
Simon Kelley
2017-09-25 20:19:55 +01:00
parent 51eadb692a
commit 6a0b00f0d6
3 changed files with 5 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
for (offset = 0; offset < (len - 5); offset += elen + 5)
{
elen = option_uint(opt, offset + 4 , 1);
if (option_uint(opt, offset, 4) == BRDBAND_FORUM_IANA)
if (option_uint(opt, offset, 4) == BRDBAND_FORUM_IANA && offset + elen + 5 <= len)
{
unsigned char *x = option_ptr(opt, offset + 5);
unsigned char *y = option_ptr(opt, offset + elen + 5);