mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-24 12:48:32 +00:00
Fix argument checking for --dhcp-match.
Spotted by Max Julian Hofmann and the Advanced Research Team at CrowdStrike
This commit is contained in:
@@ -1188,11 +1188,15 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
|||||||
{
|
{
|
||||||
new->u.vendor_class = (unsigned char *)opt_string_alloc(arg+7);
|
new->u.vendor_class = (unsigned char *)opt_string_alloc(arg+7);
|
||||||
new->flags |= DHOPT_VENDOR;
|
new->flags |= DHOPT_VENDOR;
|
||||||
|
if ((new->flags & DHOPT_ENCAPSULATE) || flags == DHOPT_MATCH)
|
||||||
|
goto_err(_("inappropriate vendor:"));
|
||||||
}
|
}
|
||||||
else if (strstr(arg, "encap:") == arg)
|
else if (strstr(arg, "encap:") == arg)
|
||||||
{
|
{
|
||||||
new->u.encap = atoi(arg+6);
|
new->u.encap = atoi(arg+6);
|
||||||
new->flags |= DHOPT_ENCAPSULATE;
|
new->flags |= DHOPT_ENCAPSULATE;
|
||||||
|
if ((new->flags & DHOPT_VENDOR) || flags == DHOPT_MATCH)
|
||||||
|
goto_err(_("inappropriate encap:"));
|
||||||
}
|
}
|
||||||
else if (strstr(arg, "vi-encap:") == arg)
|
else if (strstr(arg, "vi-encap:") == arg)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user