From d41a4030bc326b2e3d9c76ffa3c93afa0e44a355 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 16 Sep 2023 18:49:51 +0300 Subject: [PATCH] [CRT] Import parameter check for fclose from wine Fixes advpack_apitest:DelNode crash. --- sdk/lib/crt/stdio/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/lib/crt/stdio/file.c b/sdk/lib/crt/stdio/file.c index 899eeafe03e..0be80b86b28 100644 --- a/sdk/lib/crt/stdio/file.c +++ b/sdk/lib/crt/stdio/file.c @@ -2784,6 +2784,8 @@ int CDECL fclose(FILE* file) { int r, flag; + if (!MSVCRT_CHECK_PMT(file != NULL)) return EOF; + _lock_file(file); flag = file->_flag; free(file->_tmpfname);