[PATCH] ntoskrnl.exe: null initialize context.handle and context.irp

Jefferson Carpenter jeffersoncarpenter2 at gmail.com
Sat Jun 27 04:32:25 CDT 2020


Should prevent close_handle getting called with random data from the stack.

thanks,
Jefferson
-------------- next part --------------
From 4d2a82af476a7c2e08bcff17c73e03308f532227 Mon Sep 17 00:00:00 2001
From: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
Date: Sat, 27 Jun 2020 11:11:30 +0000
Subject: [PATCH] ntoskrnl.exe: null initialize context.handle and context.irp

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49462
Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
---
 dlls/ntoskrnl.exe/ntoskrnl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index f952e5d53b..d407cffee6 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -854,6 +854,8 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
     NTSTATUS status = STATUS_SUCCESS;
     HANDLE handles[2];
 
+    context.handle  = NULL;
+    context.irp     = NULL;
     context.in_size = 4096;
     context.in_buff = NULL;
 
-- 
2.23.0



More information about the wine-devel mailing list