[PATCH 1/5] msvcrt: Added NULL check in vfprintf and vfwprintf.

Eryk Wieliczko ewdevel at gmail.com
Wed Nov 24 14:12:34 CST 2010


---
 dlls/msvcrt/file.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 91cd448..ae4a215 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -3339,6 +3339,12 @@ int CDECL MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, __ms_va_list va
   pf_output out;
   int written, retval;
 
+  if( !MSVCRT_CHECK_PMT( file != NULL ) )
+  {
+    *MSVCRT__errno() = MSVCRT_EINVAL;
+    return -1;
+  }
+
   out.unicode = FALSE;
   out.buf.A = out.grow.A = buf;
   out.used = 0;
@@ -3373,6 +3379,12 @@ int CDECL MSVCRT_vfwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, __ms
   pf_output out;
   int written, retval;
 
+  if( !MSVCRT_CHECK_PMT( file != NULL ) )
+  {
+    *MSVCRT__errno() = MSVCRT_EINVAL;
+    return -1;
+  }
+
   out.unicode = TRUE;
   out.buf.W = out.grow.W = buf;
   out.used = 0;
-- 
1.7.0.4




More information about the wine-patches mailing list