Module: wine Branch: master Commit: a5665693053b15a148407481c603a848fa183726 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a5665693053b15a148407481c6... Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jul 10 15:12:12 2014 +0200 msvcrt: Always set fd to -1 in _sopen_s on failure. --- dlls/msvcrt/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 8b12ae9..0e5deba 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -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;