]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: CommonLib Fix Crash to write the last byte
authorLiming Gao <liming.gao@intel.com>
Wed, 24 Jan 2018 15:24:28 +0000 (23:24 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 25 Jan 2018 03:21:45 +0000 (11:21 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/C/Common/PcdValueCommon.c

index 32963e6c6787bffd48023b073930152bdfabe6e3..92328daa160289d395a51b63681696ad820be77b 100644 (file)
@@ -335,7 +335,7 @@ Returns:
       printf("%x\n", Byte);\r
       Value = End + 1;\r
     }\r
-    Buffer = malloc(*Size);\r
+    Buffer = malloc(*Size + 1);\r
     if (Buffer == NULL) {\r
       *Size = 0;\r
       return NULL;\r