msvcrt: Always set fd to -1 in _sopen_s on failure.

This commit is contained in:
Piotr Caban 2014-07-10 15:12:12 +02:00 committed by Alexandre Julliard
parent 887a6832bb
commit a566569305
1 changed files with 3 additions and 0 deletions

View File

@ -2185,6 +2185,9 @@ int CDECL MSVCRT__sopen_s( int *fd, const char *path, int oflags, int shflags, i
MSVCRT_wchar_t *pathW;
int ret;
if (!MSVCRT_CHECK_PMT(fd != NULL))
return MSVCRT_EINVAL;
*fd = -1;
if(!MSVCRT_CHECK_PMT(path && (pathW = msvcrt_wstrdupa(path))))
return MSVCRT_EINVAL;