* dtable.cc (dtable::dup3): Fix bounds checking for valid newfd.
* syscalls.cc (dup2): Ditto. * winsup.h (events_terminate): Delete obsolete function declaration.
This commit is contained in:
@@ -142,7 +142,7 @@ extern "C" int
|
||||
dup2 (int oldfd, int newfd)
|
||||
{
|
||||
int res;
|
||||
if (newfd >= OPEN_MAX_MAX)
|
||||
if (newfd >= OPEN_MAX_MAX || newfd < 0)
|
||||
{
|
||||
set_errno (EBADF);
|
||||
res = -1;
|
||||
|
Reference in New Issue
Block a user