Author: mjg
Date: Wed Oct 22 08:56:57 2014
New Revision: 273458
URL: https://svnweb.freebsd.org/changeset/base/273458

Log:
  filedesc assert that table size is at least 3 in fdsetugidsafety
  
  Requested by: kib

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c        Wed Oct 22 08:54:10 2014        
(r273457)
+++ head/sys/kern/kern_descrip.c        Wed Oct 22 08:56:57 2014        
(r273458)
@@ -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)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to