diff options
author | Liming Gao <liming.gao@intel.com> | 2018-01-24 23:24:28 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-01-25 11:21:45 +0800 |
commit | 4faf5340467a9595b1df7f4faf43f78ec59d3157 (patch) | |
tree | 665e5e31cd0a80eea2618232dced106f761fd8b8 /BaseTools | |
parent | 66833b2a87d98be8d81d1337c193bcbf0de47d47 (diff) | |
download | edk2-4faf5340467a9595b1df7f4faf43f78ec59d3157.tar.gz edk2-4faf5340467a9595b1df7f4faf43f78ec59d3157.tar.bz2 edk2-4faf5340467a9595b1df7f4faf43f78ec59d3157.zip |
BaseTools: CommonLib Fix Crash to write the last byte
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/C/Common/PcdValueCommon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c b/BaseTools/Source/C/Common/PcdValueCommon.c index 32963e6c67..92328daa16 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;
|