forked from Mirrors/wine-wine
msvcrt: Check if argument passed to _dup2 is positive.
parent
f4e5ab4892
commit
c2459deeff
|
@ -705,7 +705,7 @@ int CDECL MSVCRT__dup2(int od, int nd)
|
|||
|
||||
TRACE("(od=%d, nd=%d)\n", od, nd);
|
||||
LOCK_FILES();
|
||||
if (nd < MSVCRT_MAX_FILES && msvcrt_is_valid_fd(od))
|
||||
if (nd < MSVCRT_MAX_FILES && nd >= 0 && msvcrt_is_valid_fd(od))
|
||||
{
|
||||
HANDLE handle;
|
||||
|
||||
|
|
|
@ -1363,7 +1363,7 @@ static void test_unlink(void)
|
|||
|
||||
void test_dup2(void)
|
||||
{
|
||||
todo_wine ok(-1 == _dup2(0, -1), "expected _dup2 to fail when second arg is negative\n" );
|
||||
ok(-1 == _dup2(0, -1), "expected _dup2 to fail when second arg is negative\n" );
|
||||
}
|
||||
|
||||
START_TEST(file)
|
||||
|
|
Loading…
Reference in New Issue