From 962e62bcd84db8a684fb6f594b930726aa62b778 Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Thu, 16 Mar 2017 15:06:41 +0800 Subject: MdeModulePkg: Fix bug in DxeHttplib when converting port number. 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 Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Wu Jiaxin --- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c index ccc20ccf43..2ff04ffad3 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -692,6 +692,7 @@ HttpUrlGetPort ( { CHAR8 *PortString; EFI_STATUS Status; + UINTN Data; UINT32 ResultLength; HTTP_URL_PARSER *Parser; @@ -722,7 +723,10 @@ HttpUrlGetPort ( PortString[ResultLength] = '\0'; - return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port); + Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data); + + *Port = (UINT16) Data; + return Status; } /** -- cgit v1.2.3