]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpProto.c
NetworkPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpProto.c
index 486b20304f5274be71b35026c09c3f715438914b..6373f07215569319b024d91a31799ec23c501182 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for HttpDxe driver.\r
 \r
 /** @file\r
   Miscellaneous routines for HttpDxe driver.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, 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
 (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
@@ -1489,6 +1489,7 @@ HttpTcpTransmit (
   EFI_STATUS                Status;\r
   CHAR8                     *RequestMsg;\r
   CHAR8                     *Url;\r
   EFI_STATUS                Status;\r
   CHAR8                     *RequestMsg;\r
   CHAR8                     *Url;\r
+  UINTN                     UrlSize;\r
   UINTN                     RequestMsgSize;\r
 \r
   ValueInItem = (HTTP_TOKEN_WRAP *) Item->Value;\r
   UINTN                     RequestMsgSize;\r
 \r
   ValueInItem = (HTTP_TOKEN_WRAP *) Item->Value;\r
@@ -1499,12 +1500,13 @@ HttpTcpTransmit (
   //\r
   // Parse the URI of the remote host.\r
   //\r
   //\r
   // Parse the URI of the remote host.\r
   //\r
-  Url = AllocatePool (StrLen (ValueInItem->HttpToken->Message->Data.Request->Url) + 1);\r
+  UrlSize = StrLen (ValueInItem->HttpToken->Message->Data.Request->Url) + 1;\r
+  Url = AllocatePool (UrlSize);\r
   if (Url == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
   if (Url == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
-  UnicodeStrToAsciiStr (ValueInItem->HttpToken->Message->Data.Request->Url, Url);\r
+  UnicodeStrToAsciiStrS (ValueInItem->HttpToken->Message->Data.Request->Url, Url, UrlSize);\r
 \r
   //\r
   // Create request message.\r
 \r
   //\r
   // Create request message.\r