mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix check for leading zero, so that it does not block two zeroes
in hook name.
This commit is contained in:
parent
6fd53a4f81
commit
bbc8878e6d
1 changed files with 5 additions and 1 deletions
|
|
@ -147,9 +147,13 @@ ng_ipfw_newhook(node_p node, hook_p hook, const char *name)
|
|||
const char *cp;
|
||||
char *endptr;
|
||||
|
||||
/* Protect from leading zero */
|
||||
if (name[0] == '0' && name[1] != '\0')
|
||||
return (EINVAL);
|
||||
|
||||
/* Check that name contains only digits */
|
||||
for (cp = name; *cp != '\0'; cp++)
|
||||
if (!isdigit(*cp) || (cp[0] == '0' && cp[1] != '\0'))
|
||||
if (!isdigit(*cp))
|
||||
return (EINVAL);
|
||||
|
||||
/* Convert it to integer */
|
||||
|
|
|
|||
Loading…
Reference in a new issue