Commit be37986a authored by Simon Kelley's avatar Simon Kelley

Better error checking in DHCPv6 dhcp-range option parsing.

parent d7346a1e
...@@ -2371,6 +2371,13 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma ...@@ -2371,6 +2371,13 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
a[leasepos][strlen(a[leasepos]) - 1] = 0; a[leasepos][strlen(a[leasepos]) - 1] = 0;
} }
for (cp = a[leasepos]; *cp; cp++)
if (!(*cp >= '0' && *cp <= '9'))
break;
if (!cp || (leasepos+1 < k))
ret_err(_("bad dhcp-range"));
new->lease_time = atoi(a[leasepos]) * fac; new->lease_time = atoi(a[leasepos]) * fac;
/* Leases of a minute or less confuse /* Leases of a minute or less confuse
some clients, notably Apple's */ some clients, notably Apple's */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment