From aa4f917fa7dee158a58d23d420a21b0c25abc4c8 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Sat, 30 Dec 2023 19:57:41 +0100 Subject: [PATCH] Allocate and copy the appropriate amount of memory --- xtldr2/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xtldr2/volume.c b/xtldr2/volume.c index c4ded1b..32cfed7 100644 --- a/xtldr2/volume.c +++ b/xtldr2/volume.c @@ -839,8 +839,8 @@ BlpDissectVolumeArcPath(IN PWCHAR SystemPath, /* Store ARC name if possible */ if(ArcName) { - BlMemoryAllocatePool(ArcLength, (PVOID *)&LocalArcName); - RtlCopyMemory(LocalArcName, SystemPath, ArcLength); + BlMemoryAllocatePool(ArcLength * sizeof(WCHAR), (PVOID *)&LocalArcName); + RtlCopyMemory(LocalArcName, SystemPath, ArcLength * sizeof(WCHAR)); LocalArcName[ArcLength] = '\0'; *ArcName = LocalArcName; }