[NTOS:IO] Check RtlAnsiStringToUnicodeString return value when initializing Arc names

CORE-17637
This commit is contained in:
Jérôme Gardou 2021-06-17 16:36:32 +02:00 committed by Jérôme Gardou
parent 293f823053
commit 24a4e12a76

View file

@ -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);