diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2005-05-29 12:20:41 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2005-05-29 12:20:41 +0000 |
| commit | bbc8878e6dcd491d89529c92d9247781751296d7 (patch) | |
| tree | 2d3d084dd36e2e741c908bed845fff9dbc8421a7 /sys | |
| parent | 6fd53a4f81d06e088ac007c646254acb413ba3fd (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/netgraph/ng_ipfw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netgraph/ng_ipfw.c b/sys/netgraph/ng_ipfw.c index 031a6157d288..f2e4a7f4dbba 100644 --- a/sys/netgraph/ng_ipfw.c +++ b/sys/netgraph/ng_ipfw.c @@ -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 */ |
