filedesc assert that table size is at least 3 in fdsetugidsafety

Requested by: kib
This commit is contained in:
Mateusz Guzik 2014-10-22 08:56:57 +00:00
parent 4f8244bbf7
commit 58a3dcb229
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273458

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)) {