https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3f16c8615c816c7617d47…
commit 3f16c8615c816c7617d478bcc155e3ae26ea3226
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu Jun 17 16:38:32 2021 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon Jun 28 10:20:57 2021 +0200
[NTOS:IO] Check RtlCreateUnicodeString return value when initializing PnP services
CORE-17637
---
ntoskrnl/io/pnpmgr/pnpinit.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/io/pnpmgr/pnpinit.c b/ntoskrnl/io/pnpmgr/pnpinit.c
index b189ac8280a..b1a5e24c8e5 100644
--- a/ntoskrnl/io/pnpmgr/pnpinit.c
+++ b/ntoskrnl/io/pnpmgr/pnpinit.c
@@ -435,8 +435,11 @@ IopInitializePlugPlayServices(VOID)
DNF_IDS_QUERIED | DNF_NO_RESOURCE_REQUIRED;
/* Create instance path */
- RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath,
- REGSTR_VAL_ROOT_DEVNODE);
+ if (!RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath,
REGSTR_VAL_ROOT_DEVNODE))
+ {
+ DPRINT1("RtlCreateUnicodeString() failed\n");
+ KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
+ }
/* Call the add device routine */
IopRootDriverObject->DriverExtension->AddDevice(IopRootDriverObject,