mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
if there are leading zeros fail the lookup
Pointed out by: Alexander Viro <viro@math.psu.edu>
This commit is contained in:
parent
8d107d1210
commit
70cb8de9ba
2 changed files with 10 additions and 0 deletions
|
|
@ -198,6 +198,11 @@ fdesc_lookup(ap)
|
|||
}
|
||||
|
||||
fd = 0;
|
||||
/* the only time a leading 0 is acceptable is if it's "0" */
|
||||
if (*pname == '0' && nlen != 1) {
|
||||
error = ENOENT;
|
||||
goto bad;
|
||||
}
|
||||
while (nlen--) {
|
||||
if (*pname < '0' || *pname > '9') {
|
||||
error = ENOENT;
|
||||
|
|
|
|||
|
|
@ -198,6 +198,11 @@ fdesc_lookup(ap)
|
|||
}
|
||||
|
||||
fd = 0;
|
||||
/* the only time a leading 0 is acceptable is if it's "0" */
|
||||
if (*pname == '0' && nlen != 1) {
|
||||
error = ENOENT;
|
||||
goto bad;
|
||||
}
|
||||
while (nlen--) {
|
||||
if (*pname < '0' || *pname > '9') {
|
||||
error = ENOENT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue