From nobody Thu May 2 10:44:36 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 1489648134417451.245571199991; Thu, 16 Mar 2017 00:08:54 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6A241803FC; Thu, 16 Mar 2017 00:08:51 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 DA1F88034C for ; Thu, 16 Mar 2017 00:08:50 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 16 Mar 2017 00:08:50 -0700 Received: from shwdeopenpsi116.ccr.corp.intel.com ([10.239.9.23]) by orsmga002.jf.intel.com with ESMTP; 16 Mar 2017 00:08:49 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,170,1486454400"; d="scan'208";a="61053229" From: Zhang Lubo To: edk2-devel@lists.01.org Date: Thu, 16 Mar 2017 15:08:47 +0800 Message-Id: <1489648127-6200-1-git-send-email-lubo.zhang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port number. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 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" 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(-) diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Li= brary/DxeHttpLib/DxeHttpLib.c index ccc20cc..2ff04ff 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -690,10 +690,11 @@ HttpUrlGetPort ( OUT UINT16 *Port ) { CHAR8 *PortString; EFI_STATUS Status; + UINTN Data; UINT32 ResultLength; HTTP_URL_PARSER *Parser; =20 if (Url =3D=3D NULL || UrlParser =3D=3D NULL || Port =3D=3D NULL) { return EFI_INVALID_PARAMETER; @@ -720,11 +721,14 @@ HttpUrlGetPort ( return Status; } =20 PortString[ResultLength] =3D '\0'; =20 - return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_P= ORT].Offset, (CHAR8 **) NULL, (UINTN *) Port); + Status =3D AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FI= ELD_PORT].Offset, (CHAR8 **) NULL, &Data); + + *Port =3D (UINT16) Data; + return Status; } =20 /** Get the Path from a HTTP URL. =20 --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel