public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: CommonLib Fix Crash to write the last byte
@ 2018-01-25  1:42 Liming Gao
  2018-01-25  2:45 ` Zhu, Yonghong
  0 siblings, 1 reply; 2+ messages in thread
From: Liming Gao @ 2018-01-25  1:42 UTC (permalink / raw)
  To: edk2-devel

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/C/Common/PcdValueCommon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c b/BaseTools/Source/C/Common/PcdValueCommon.c
index 32963e6..92328da 100644
--- a/BaseTools/Source/C/Common/PcdValueCommon.c
+++ b/BaseTools/Source/C/Common/PcdValueCommon.c
@@ -335,7 +335,7 @@ Returns:
       printf("%x\n", Byte);
       Value = End + 1;
     }
-    Buffer = malloc(*Size);
+    Buffer = malloc(*Size + 1);
     if (Buffer == NULL) {
       *Size = 0;
       return NULL;
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-25  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25  1:42 [Patch] BaseTools: CommonLib Fix Crash to write the last byte Liming Gao
2018-01-25  2:45 ` Zhu, Yonghong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox