https://git.reactos.org/?p=reactos.git;a=commitdiff;h=24a4e12a769ab91027dc1a...
commit 24a4e12a769ab91027dc1a51e7579d138a3cdd91 Author: Jérôme Gardou jerome.gardou@reactos.org AuthorDate: Thu Jun 17 16:36:32 2021 +0200 Commit: Jérôme Gardou zefklop@users.noreply.github.com CommitDate: Mon Jun 28 10:20:57 2021 +0200
[NTOS:IO] Check RtlAnsiStringToUnicodeString return value when initializing Arc names
CORE-17637 --- ntoskrnl/io/iomgr/arcname.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/io/iomgr/arcname.c b/ntoskrnl/io/iomgr/arcname.c index 937b5cfb0c5..3b516c40ddc 100644 --- a/ntoskrnl/io/iomgr/arcname.c +++ b/ntoskrnl/io/iomgr/arcname.c @@ -54,12 +54,16 @@ IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Create the global HAL partition name */ sprintf(Buffer, "\ArcName\%s", LoaderBlock->ArcHalDeviceName); RtlInitAnsiString(&ArcString, Buffer); - RtlAnsiStringToUnicodeString(&IoArcHalDeviceName, &ArcString, TRUE); + Status = RtlAnsiStringToUnicodeString(&IoArcHalDeviceName, &ArcString, TRUE); + if (!NT_SUCCESS(Status)) + return Status;
/* Create the global system partition name */ sprintf(Buffer, "\ArcName\%s", LoaderBlock->ArcBootDeviceName); RtlInitAnsiString(&ArcString, Buffer); - RtlAnsiStringToUnicodeString(&IoArcBootDeviceName, &ArcString, TRUE); + Status = RtlAnsiStringToUnicodeString(&IoArcBootDeviceName, &ArcString, TRUE); + if (!NT_SUCCESS(Status)) + return Status;
/* Allocate memory for the string */ Length = strlen(LoaderBlock->ArcBootDeviceName) + sizeof(ANSI_NULL);