From nobody Sat Nov 2 14:34:39 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1486529906927444.2712626424686; Tue, 7 Feb 2017 20:58:26 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 46A4F81F5C; Tue, 7 Feb 2017 20:58:25 -0800 (PST) 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 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 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="63149536" From: Jiaxin Wu To: edk2-devel@lists.01.org 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: [edk2] [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: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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/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 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; } =20 PortString[ResultLength] =3D '\0'; - *Port =3D (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_= URI_FIELD_PORT].Offset); =20 - return EFI_SUCCESS; + return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_P= ORT].Offset, (CHAR8 **) NULL, (UINTN *) 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, Con= tentLength); } =20 /** =20 Check whether the HTTP message is using the "chunked" transfer-coding. --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel