filedesc assert that table size is at least 3 in fdsetugidsafety

Requested by: kib
This commit is contained in:
mjg 2014-10-22 08:56:57 +00:00
parent b2dfe7e8d8
commit 04223abe34

View File

@ -2102,6 +2102,7 @@ fdsetugidsafety(struct thread *td)
fdp = td->td_proc->p_fd;
KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
MPASS(fdp->fd_nfiles >= 3);
for (i = 0; i <= 2; i++) {
fp = fdp->fd_ofiles[i].fde_file;
if (fp != NULL && is_unsafe(fp)) {