From 0756eb9b291bbb11e73ccea117eb13d780d625b7 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Mon, 29 Apr 2024 22:39:32 +0200 Subject: [PATCH] Allocate memory before copying a buffer --- xtldr/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xtldr/protocol.c b/xtldr/protocol.c index 59394e1..d90f33c 100644 --- a/xtldr/protocol.c +++ b/xtldr/protocol.c @@ -812,8 +812,8 @@ BlpGetModuleInfoStrings(IN PWCHAR SectionData, return STATUS_EFI_OUT_OF_RESOURCES; } - /* Cioy strings read from '.modinfo' section */ - String = (PWCHAR)(Array + Count + 1); + /* Allocate memory and copy strings read from '.modinfo' section */ + BlAllocateMemoryPool(SectionSize, (PVOID*)&String); RtlCopyMemory(String, InfoStrings, SectionSize); /* Make sure last string is NULL-terminated */