kernel32: Replace NULL argument with pointer to DWORD

Hugh McMaster hugh.mcmaster at outlook.com
Mon Nov 30 02:08:42 CST 2015


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

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 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;
 }
-- 
1.9.1




More information about the wine-patches mailing list