]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c
DynamicTablesPkg: GTDT updates for ACPI 6.3
[mirror_edk2.git] / NetworkPkg / HttpUtilitiesDxe / HttpUtilitiesProtocol.c
index a9a1c7c586cc60fba3c6206f8f09c546ec28fa8b..bd4df90e05e05b1bbb48079cc44f1617cf34e1ec 100644 (file)
@@ -3,13 +3,7 @@
 \r
   Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -298,6 +292,7 @@ HttpUtilitiesParse (
   CHAR8                     *FieldName;\r
   CHAR8                     *FieldValue;\r
   UINTN                     Index;\r
+  UINTN                     HttpBufferSize;\r
 \r
   Status          = EFI_SUCCESS;\r
   TempHttpMessage = NULL;\r
@@ -311,12 +306,17 @@ HttpUtilitiesParse (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  TempHttpMessage = AllocateZeroPool (HttpMessageSize);\r
+  //\r
+  // Append the http response string along with a Null-terminator.\r
+  //\r
+  HttpBufferSize = HttpMessageSize + 1;\r
+  TempHttpMessage = AllocatePool (HttpBufferSize);\r
   if (TempHttpMessage == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
   CopyMem (TempHttpMessage, HttpMessage, HttpMessageSize);\r
+  *(TempHttpMessage + HttpMessageSize) = '\0';\r
 \r
   //\r
   // Get header number\r