summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpUtilitiesDxe
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/HttpUtilitiesDxe')
-rw-r--r--NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c b/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c
index a9a1c7c586..b0e3e7f081 100644
--- a/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c
+++ b/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c
@@ -298,6 +298,7 @@ HttpUtilitiesParse (
CHAR8 *FieldName;
CHAR8 *FieldValue;
UINTN Index;
+ UINTN HttpBufferSize;
Status = EFI_SUCCESS;
TempHttpMessage = NULL;
@@ -311,12 +312,17 @@ HttpUtilitiesParse (
return EFI_INVALID_PARAMETER;
}
- TempHttpMessage = AllocateZeroPool (HttpMessageSize);
+ //
+ // Append the http response string along with a Null-terminator.
+ //
+ HttpBufferSize = HttpMessageSize + 1;
+ TempHttpMessage = AllocatePool (HttpBufferSize);
if (TempHttpMessage == NULL) {
return EFI_OUT_OF_RESOURCES;
}
CopyMem (TempHttpMessage, HttpMessage, HttpMessageSize);
+ *(TempHttpMessage + HttpMessageSize) = '\0';
//
// Get header number