https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d41a4030bc326b2e3d9c76ffa3c93afa0e44a355

commit d41a4030bc326b2e3d9c76ffa3c93afa0e44a355
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Sat Sep 16 18:49:51 2023 +0300
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sun Sep 17 10:19:15 2023 +0300

    [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);

Reply via email to