summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r--BaseTools/Source/C/Common/MemoryFile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/C/Common/MemoryFile.c b/BaseTools/Source/C/Common/MemoryFile.c
index 7b1aa111d1..00ea0c615b 100644
--- a/BaseTools/Source/C/Common/MemoryFile.c
+++ b/BaseTools/Source/C/Common/MemoryFile.c
@@ -194,7 +194,7 @@ Returns:
CharsToCopy = EndOfLine - InputFile->CurrentFilePointer;
}
- OutputString = malloc (CharsToCopy);
+ OutputString = malloc (CharsToCopy + 1);
if (OutputString == NULL) {
return NULL;
}