summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Palmer <thomas.palmer@hpe.com>2018-06-26 02:15:18 +0800
committerHao Wu <hao.a.wu@intel.com>2018-06-27 08:58:56 +0800
commitd1fbfd7cd39af04d80ee9dab1455cccdf84aa316 (patch)
treed093202f798e5258ac3062e1bdc4ba0c279a67cb
parente57350403e3b881d56b49ec104ff0b448a8e0d98 (diff)
downloadedk2-d1fbfd7cd39af04d80ee9dab1455cccdf84aa316.tar.gz
edk2-d1fbfd7cd39af04d80ee9dab1455cccdf84aa316.tar.bz2
edk2-d1fbfd7cd39af04d80ee9dab1455cccdf84aa316.zip
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 <thomas.palmer@hpe.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
-rw-r--r--Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c3
1 files changed, 2 insertions, 1 deletions
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.<BR>
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
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;