if there are leading zeros fail the lookup

Pointed out by: Alexander Viro <viro@math.psu.edu>
This commit is contained in:
Alfred Perlstein 2000-06-27 21:37:17 +00:00
parent 8d107d1210
commit 70cb8de9ba
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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;