filedesc assert that table size is at least 3 in fdsetugidsafety
Requested by: kib
This commit is contained in:
parent
4f8244bbf7
commit
58a3dcb229
@ -2102,6 +2102,7 @@ fdsetugidsafety(struct thread *td)
|
|||||||
|
|
||||||
fdp = td->td_proc->p_fd;
|
fdp = td->td_proc->p_fd;
|
||||||
KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
|
KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
|
||||||
|
MPASS(fdp->fd_nfiles >= 3);
|
||||||
for (i = 0; i <= 2; i++) {
|
for (i = 0; i <= 2; i++) {
|
||||||
fp = fdp->fd_ofiles[i].fde_file;
|
fp = fdp->fd_ofiles[i].fde_file;
|
||||||
if (fp != NULL && is_unsafe(fp)) {
|
if (fp != NULL && is_unsafe(fp)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user