]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size
authorThomas Palmer <thomas.palmer@hpe.com>
Mon, 25 Jun 2018 18:15:18 +0000 (02:15 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 27 Jun 2018 00:58:56 +0000 (08:58 +0800)
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>
Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c

index 1516ab8d1c12ec6b2a06d96d9f65a74bee9bc3cb..cfce4a0af34575050c6e4f589758eaa5688cb6d1 100644 (file)
@@ -1,6 +1,7 @@
 /**@file\r
 \r
 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
 /**@file\r
 \r
 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -453,7 +454,7 @@ Returns:
     ASSERT (PcdTempStr != NULL);\r
 \r
     TempStrSize = StrLen (PcdTempStr);\r
     ASSERT (PcdTempStr != NULL);\r
 \r
     TempStrSize = StrLen (PcdTempStr);\r
-    TempStr = AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1);\r
+    TempStr = AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16)));\r
     StrCpy (TempStr, PcdTempStr);\r
 \r
     StartString = TempStr;\r
     StrCpy (TempStr, PcdTempStr);\r
 \r
     StartString = TempStr;\r