Hugh McMaster : kernel32: Replace NULL argument with pointer to DWORD.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 30 09:54:02 CST 2015


Module: wine
Branch: master
Commit: 7223330ffc15b0d824b601bb23d3e2c61258b9da
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7223330ffc15b0d824b601bb23d3e2c61258b9da

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon Nov 30 19:08:42 2015 +1100

kernel32: Replace NULL argument with pointer to DWORD.

On Windows, passing in NULL can cause a memory access violation.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/editline.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c
index db17508..78ea789 100644
--- a/dlls/kernel32/editline.c
+++ b/dlls/kernel32/editline.c
@@ -98,7 +98,9 @@ static void WCEL_Dump(WCEL_Context* ctx, const char* pfx)
 
 static BOOL WCEL_Get(WCEL_Context* ctx, INPUT_RECORD* ir)
 {
-    if (ReadConsoleInputW(ctx->hConIn, ir, 1, NULL)) return TRUE;
+    DWORD num_read;
+
+    if (ReadConsoleInputW(ctx->hConIn, ir, 1, &num_read)) return TRUE;
     ctx->error = 1;
     return FALSE;
 }




More information about the wine-cvs mailing list