From 27fd61af01453b997ef1b79b91dfb7fa65d2e253 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Wed, 8 Feb 2017 11:56:54 +0800 Subject: [PATCH] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the correct status for the HTTP Port/ContentLength. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting --- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c index 8734291ae3..ccc20ccf43 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -2,7 +2,7 @@ This library is used to share code between UEFI network stack modules. It provides the helper routines to parse the HTTP message byte stream. -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -721,9 +721,8 @@ HttpUrlGetPort ( } PortString[ResultLength] = '\0'; - *Port = (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset); - return EFI_SUCCESS; + return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port); } /** @@ -932,8 +931,7 @@ HttpIoParseContentLengthHeader ( return EFI_NOT_FOUND; } - *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue); - return EFI_SUCCESS; + return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, ContentLength); } /** -- 2.39.2