Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Oct 2018 19:08:06 +0000 (UTC)
From:      =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r339821 - stable/11/sys/sys
Message-ID:  <201810271908.w9RJ86sk082939@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Sat Oct 27 19:08:06 2018
New Revision: 339821
URL: https://svnweb.freebsd.org/changeset/base/339821

Log:
  MFH (r305124): fix case where fd_lastfile is -1.

Modified:
  stable/11/sys/sys/filedesc.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/filedesc.h
==============================================================================
--- stable/11/sys/sys/filedesc.h	Sat Oct 27 18:48:49 2018	(r339820)
+++ stable/11/sys/sys/filedesc.h	Sat Oct 27 19:08:06 2018	(r339821)
@@ -219,7 +219,7 @@ fdeget_locked(struct filedesc *fdp, int fd)
 
 	FILEDESC_LOCK_ASSERT(fdp);
 
-	if ((u_int)fd > fdp->fd_lastfile)
+	if (fd < 0 || fd > fdp->fd_lastfile)
 		return (NULL);
 
 	fde = &fdp->fd_ofiles[fd];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810271908.w9RJ86sk082939>