msvcrt: Always set fd to -1 in _sopen_s on failure.
This commit is contained in:
parent
887a6832bb
commit
a566569305
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue