diff options
| author | Bruce Evans <bde@FreeBSD.org> | 1996-12-01 16:05:44 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 1996-12-01 16:05:44 +0000 |
| commit | 4958bbd17589233e18bd939384639b4bb719818b (patch) | |
| tree | 8f1e3c321430ab683a7dead3943c6423aeaec346 | |
| parent | 621d520e2fe6f7741658c7fe1c35f545a9e98b03 (diff) | |
Notes
| -rw-r--r-- | sys/kern/vfs_lookup.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 6c40c0c27a03..bad441432f6e 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 - * $Id: vfs_lookup.c,v 1.10 1995/10/22 09:32:25 davidg Exp $ + * $Id: vfs_lookup.c,v 1.11 1996/01/03 21:42:22 wollman Exp $ */ #include "opt_ktrace.h" @@ -112,6 +112,13 @@ namei(ndp) else error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, (u_int *)&ndp->ni_pathlen); + + /* + * Don't allow empty pathnames. + */ + if (!error && *cnp->cn_pnbuf == '\0') + error = ENOENT; + if (error) { free(cnp->cn_pnbuf, M_NAMEI); ndp->ni_vp = NULL; |
