]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
MdeModulePkg/BootGraphicsResourceTableDxe: don't allocate below 4 GB
[mirror_edk2.git] / MdeModulePkg / Library / DxeHttpLib / DxeHttpLib.c
index 46f035ab39fbd6e197dc0d3e6c1c2457776efa45..2ff04ffad3ac1b4976c20e1f18a9c12a041f14bd 100644 (file)
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.\r
   It provides the helper routines to parse the HTTP message byte stream.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, 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
@@ -396,7 +396,7 @@ HttpParseUrl (
   FoundAt = FALSE;\r
   for (Char = Url; Char < Url + Length; Char++) {\r
     //\r
-    // Update state machine accoring to next char.\r
+    // Update state machine according to next char.\r
     //\r
     State = NetHttpParseUrlChar (*Char, State);\r
 \r
@@ -692,6 +692,7 @@ HttpUrlGetPort (
 {\r
   CHAR8         *PortString;\r
   EFI_STATUS    Status;\r
+  UINTN         Data;\r
   UINT32        ResultLength;\r
   HTTP_URL_PARSER      *Parser;\r
 \r
@@ -721,9 +722,11 @@ HttpUrlGetPort (
   }\r
 \r
   PortString[ResultLength] = '\0';\r
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);\r
 \r
-  return  EFI_SUCCESS;\r
+  Status =  AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data);\r
+\r
+  *Port = (UINT16) Data;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -932,8 +935,7 @@ HttpIoParseContentLengthHeader (
     return EFI_NOT_FOUND;\r
   }\r
 \r
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);\r
-  return EFI_SUCCESS;\r
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, ContentLength);\r
 }\r
 \r
 /**\r
@@ -1430,10 +1432,10 @@ HttpFreeMsgParser (
 \r
 \r
 /**\r
-  Get the next string, which is distinguished by specified seperator.\r
+  Get the next string, which is distinguished by specified separator.\r
 \r
   @param[in]  String             Pointer to the string.\r
-  @param[in]  Seperator          Specified seperator used to distinguish where is the beginning\r
+  @param[in]  Separator          Specified separator used to distinguish where is the beginning\r
                                  of next string.\r
 \r
   @return     Pointer to the next string.\r
@@ -1444,7 +1446,7 @@ CHAR8 *
 EFIAPI\r
 AsciiStrGetNextToken (\r
   IN CONST CHAR8 *String,\r
-  IN       CHAR8 Seperator\r
+  IN       CHAR8 Separator\r
   )\r
 {\r
   CONST CHAR8 *Token;\r
@@ -1454,7 +1456,7 @@ AsciiStrGetNextToken (
     if (*Token == 0) {\r
       return NULL;\r
     }\r
-    if (*Token == Seperator) {\r
+    if (*Token == Separator) {\r
       return (CHAR8 *)(Token + 1);\r
     }\r
     Token++;\r
@@ -1673,11 +1675,13 @@ HttpGenRequestMessage (
 \r
   ASSERT (Message != NULL);\r
 \r
-  *RequestMsg = NULL;\r
-  MsgSize = 0;\r
-  Success = FALSE;\r
-  HttpHdr = NULL;\r
-  AppendList = NULL;\r
+  *RequestMsg           = NULL;\r
+  Status                = EFI_SUCCESS;\r
+  HttpHdrSize           = 0;\r
+  MsgSize               = 0;\r
+  Success               = FALSE;\r
+  HttpHdr               = NULL;\r
+  AppendList            = NULL;\r
   HttpUtilitiesProtocol = NULL;\r
 \r
   //\r