From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 2D66C80400 for ; Thu, 16 Mar 2017 00:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489648358; x=1521184358; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xGNMphcqkMLvAvwAIDlRJqZCcSM4bAg2HCmxtRyScX8=; b=FVF+1fcqbJtM5AfdOjnywsXtCrs+XlwK16AB3Ov3SxIaADmDjh+x5/rL IU5ZDX10yNdhNe67C1qxRaMibHNMCQ==; Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2017 00:12:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,170,1486454400"; d="scan'208";a="67890353" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 16 Mar 2017 00:12:37 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 16 Mar 2017 00:12:37 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 16 Mar 2017 00:12:37 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Thu, 16 Mar 2017 15:12:33 +0800 From: "Wu, Jiaxin" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port number. Thread-Index: AQHSniQ5KNhkvMwiyEKqg6MH0kTkI6GXDQnA Date: Thu, 16 Mar 2017 07:12:33 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162A3ADB@SHSMSX103.ccr.corp.intel.com> References: <1489648127-6200-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1489648127-6200-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjcyMDU3NjYtZGU2NS00YWNjLWE0MGUtNThkZWVjYjZlNzk0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImFEMzRzRUdMUnMxYjRUZHVBbHh0RUJQV05KUytoNFJBSkhTREVGdlpXUG89In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 16 Mar 2017 07:12:38 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -----Original Message----- > From: Zhang, Lubo > Sent: Thursday, March 16, 2017 3:09 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port > number. >=20 > Http boot on X64 platform is faild, this is caused by the incorrect > type conversion when getting port number from Url. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Zhang Lubo > Cc: Ye Ting > Cc: Fu Siyuan > Cc: Wu Jiaxin > --- > MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c > b/MdeModulePkg/Library/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_PORT].Offset, (CHAR8 **) NULL, (UINTN *) > Port); > + Status =3D AsciiStrDecimalToUintnS (Url + Parser- > >FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data); > + > + *Port =3D (UINT16) Data; > + return Status; > } >=20 > /** > Get the Path from a HTTP URL. >=20 > -- > 1.9.5.msysgit.1