summaryrefslogtreecommitdiffstats
path: root/sys/miscfs
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2000-06-27 21:37:17 +0000
committeralfred <alfred@FreeBSD.org>2000-06-27 21:37:17 +0000
commit688747516283066539a75b7e4c858de3a26e1424 (patch)
tree1df84152547e8bca076e39465895b1b9ac5cb746 /sys/miscfs
parent685b55093c390c42f0371340e0c057c475c1af39 (diff)
downloadFreeBSD-src-688747516283066539a75b7e4c858de3a26e1424.zip
FreeBSD-src-688747516283066539a75b7e4c858de3a26e1424.tar.gz
if there are leading zeros fail the lookup
Pointed out by: Alexander Viro <viro@math.psu.edu>
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fdesc/fdesc_vnops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c
index 33d2f49..09c5c37 100644
--- a/sys/miscfs/fdesc/fdesc_vnops.c
+++ b/sys/miscfs/fdesc/fdesc_vnops.c
@@ -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;
OpenPOWER on IntegriCloud