From: Thomas Palmer Date: Mon, 25 Jun 2018 18:15:18 +0000 (+0800) Subject: Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size X-Git-Tag: edk2-stable201903~1531 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=d1fbfd7cd39af04d80ee9dab1455cccdf84aa316 Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size A single byte was allocate for a CHAR16 NUL terminator when instead two bytes should have been used. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer Reviewed-by: Hao Wu --- diff --git a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c index 1516ab8d1c..cfce4a0af3 100644 --- a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c +++ b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c @@ -1,6 +1,7 @@ /**@file Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -453,7 +454,7 @@ Returns: ASSERT (PcdTempStr != NULL); TempStrSize = StrLen (PcdTempStr); - TempStr = AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1); + TempStr = AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16))); StrCpy (TempStr, PcdTempStr); StartString = TempStr;