]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Fix bug in DxeHttplib when converting port number.
authorZhang Lubo <lubo.zhang@intel.com>
Thu, 16 Mar 2017 07:06:41 +0000 (15:06 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Fri, 17 Mar 2017 02:14:24 +0000 (10:14 +0800)
Http boot on X64 platform is faild, this is caused by the incorrect
type conversion when getting port number from Url.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c

index ccc20ccf43354a07c79b54555eb73b4b60602903..2ff04ffad3ac1b4976c20e1f18a9c12a041f14bd 100644 (file)
@@ -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
@@ -722,7 +723,10 @@ HttpUrlGetPort (
 \r
   PortString[ResultLength] = '\0';\r
 \r
-  return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port);\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