Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assorted stuff #3392

Merged
merged 8 commits into from Jun 4, 2016
3 changes: 2 additions & 1 deletion src/libsystemd-network/sd-dhcp-server.c
Expand Up @@ -633,7 +633,8 @@ static int parse_request(uint8_t code, uint8_t len, const void *option, void *us

break;
case SD_DHCP_OPTION_MAXIMUM_MESSAGE_SIZE:
if (len == 2)

if (len == 2 && unaligned_read_be16(option) >= sizeof(DHCPPacket))
req->max_optlen = unaligned_read_be16(option) - sizeof(DHCPPacket);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't reject the packet instead. But maybe that's too harsh. Simply ignoring the invalid option sounds OK too.

break;
Expand Down