https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1d18b12ff7a39f86abbf1…
commit 1d18b12ff7a39f86abbf1d98f9b40821dd003094
Author: Adam Słaboń <asaillen(a)protonmail.com>
AuthorDate: Sun Mar 3 00:17:39 2024 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Oct 7 11:16:03 2024 +0200
[NTOS:PNP] PiNotifyTargetDeviceChange: Don't free incorrect buffer
---
ntoskrnl/io/pnpmgr/pnpnotify.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/io/pnpmgr/pnpnotify.c b/ntoskrnl/io/pnpmgr/pnpnotify.c
index cc169aba171..35a503bfe2d 100644
--- a/ntoskrnl/io/pnpmgr/pnpnotify.c
+++ b/ntoskrnl/io/pnpmgr/pnpnotify.c
@@ -315,7 +315,8 @@ PiNotifyTargetDeviceChange(
}
KeReleaseGuardedMutex(&PiNotifyTargetDeviceLock);
- ExFreePoolWithTag(notificationStruct, TAG_PNP_NOTIFY);
+ if (notificationStruct != CustomNotification)
+ ExFreePoolWithTag(notificationStruct, TAG_PNP_NOTIFY);
ObDereferenceObject(DeviceObject);
}