From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 8C4C281FEC for ; Tue, 7 Feb 2017 23:01:03 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP; 07 Feb 2017 23:01:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="62142401" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 07 Feb 2017 23:01:03 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 7 Feb 2017 23:01:03 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Wed, 8 Feb 2017 15:01:00 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" Thread-Topic: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength Thread-Index: AQHSgcf7YcPUBH6CrEy7QZe112laFqFerpJw Date: Wed, 8 Feb 2017 07:01:00 +0000 Message-ID: References: <1486529901-71800-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1486529901-71800-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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 07:01:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting -----Original Message----- From: Wu, Jiaxin=20 Sent: Wednesday, February 08, 2017 12:58 PM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jia= xin Subject: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the= HTTP Port/ContentLength Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the c= orrect 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/Li= brary/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. =20 -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 pro= gram and the accompanying materials are licensed and made available under = the terms and conditions of the BSD License which accompanies this distrib= ution. 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; } =20 PortString[ResultLength] =3D '\0'; - *Port =3D (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_= URI_FIELD_PORT].Offset); =20 - return EFI_SUCCESS; + return AsciiStrDecimalToUintnS (Url +=20 + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN=20 + *) Port); } =20 /** Get the Path from a HTTP URL. =20 @@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader ( Header =3D HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LEN= GTH); if (Header =3D=3D NULL) { return EFI_NOT_FOUND; } =20 - *ContentLength =3D AsciiStrDecimalToUintn (Header->FieldValue); - return EFI_SUCCESS; + return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL,=20 + ContentLength); } =20 /** =20 Check whether the HTTP message is using the "chunked" transfer-coding. -- 1.9.5.msysgit.1