From 1d96af3b98501370a5b0efb3e7d57243a8dda8d2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 27 Jun 2019 11:57:14 +0000 Subject: [PATCH] Account for device removal before initialization Signed-off-by: Jason A. Donenfeld --- wintun.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wintun.c b/wintun.c index 26d2c1e..8db1924 100644 --- a/wintun.c +++ b/wintun.c @@ -1069,6 +1069,8 @@ TunDispatchPnP(DEVICE_OBJECT *DeviceObject, IRP *Irp) { #pragma warning(suppress : 28175) TUN_CTX *ctx = DeviceObject->Reserved; + if (!ctx) + return NdisDispatchPnP(DeviceObject, Irp); switch (stack->MinorFunction) {