From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4EF2481F56 for ; Tue, 7 Feb 2017 20:58:24 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP; 07 Feb 2017 20:58:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="63149536" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.106]) by fmsmga006.fm.intel.com with ESMTP; 07 Feb 2017 20:58:22 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Jiaxin Date: Wed, 8 Feb 2017 12:58:21 +0800 Message-Id: <1486529901-71800-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2017 04:58:24 -0000 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 --- 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 a4579bf..ff7e799 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -1,10 +1,10 @@ /** @file 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php @@ -719,13 +719,12 @@ HttpUrlGetPort ( if (EFI_ERROR (Status)) { return Status; } 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); } /** Get the Path from a HTTP URL. @@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader ( Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH); if (Header == NULL) { return EFI_NOT_FOUND; } - *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue); - return EFI_SUCCESS; + return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, ContentLength); } /** Check whether the HTTP message is using the "chunked" transfer-coding. -- 1.9.5.msysgit.1