From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 194F622423848 for ; Wed, 28 Feb 2018 22:59:09 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 23:05:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="35043578" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 28 Feb 2018 23:05:17 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Feb 2018 23:05:16 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Feb 2018 23:05:16 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.125]) with mapi id 14.03.0319.002; Thu, 1 Mar 2018 15:05:14 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wu, Jiaxin" Thread-Topic: [edk2] [Patch] NetworkPkg/HttpBootDxe: Correct the parameter check for the usage of HttpBootGetFileFromCache. Thread-Index: AQHTsSauNQH5NeCUEUW5cKaI2HPQ2KO69PVw Date: Thu, 1 Mar 2018 07:05:14 +0000 Message-ID: References: <20180301062932.14280-1-jiaxin.wu@intel.com> In-Reply-To: <20180301062932.14280-1-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjQ2Zjg5ODMtZmY3Ny00MzU4LWI0ZTMtNjg5N2QzMTBiMmE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJnbzB2NnluQ1wvVjFKQ1FEYUhxbTVNZUdqdlRZZnhSc3ZuRVA5NW1HK0xrTXd2aE1OYmQ0b3hkQXdnVnpRdHpqRSJ9 dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/HttpBootDxe: Correct the parameter check for the usage of HttpBootGetFileFromCache. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:59:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jiaxin Wu > Sent: Thursday, March 1, 2018 2:30 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [edk2] [Patch] NetworkPkg/HttpBootDxe: Correct the parameter > check for the usage of HttpBootGetFileFromCache. >=20 > The patch is to fix the incorrect parameter check for the > HttpBootGetFileFromCache(). >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wu Jiaxin > --- > NetworkPkg/HttpBootDxe/HttpBootClient.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) >=20 > diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c > b/NetworkPkg/HttpBootDxe/HttpBootClient.c > index 15e0ab9d69..b93e63bb2f 100644 > --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c > +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c > @@ -1,9 +1,9 @@ > /** @file > Implementation of the boot file download function. >=20 > -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2018, 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 that accompanies this > distribution. > The full text of the license may be found at > http://opensource.org/licenses/bsd-license.php. > @@ -434,11 +434,11 @@ HttpBootDhcp6ExtractUriInfo ( > goto Error; > } > } >=20 > // > - // Extract the HTTP server Ip frome URL. This is used to Check route > table > + // Extract the HTTP server Ip from URL. This is used to Check route > table > // whether can send message to HTTP Server Ip through the GateWay. > // > Status =3D HttpUrlGetIp6 ( > Private->BootFileUri, > Private->BootFileUriParser, > @@ -744,23 +744,22 @@ HttpBootGetFileFromCache ( > LIST_ENTRY *Entry2; > HTTP_BOOT_CACHE_CONTENT *Cache; > HTTP_BOOT_ENTITY_DATA *EntityData; > UINTN CopyedSize; >=20 > - if (Uri =3D=3D NULL || BufferSize =3D=3D 0 || Buffer =3D=3D NULL || Im= ageType =3D=3D > NULL) { > + if (Uri =3D=3D NULL || BufferSize =3D=3D NULL || Buffer =3D=3D NULL ||= ImageType =3D=3D > NULL) { > return EFI_INVALID_PARAMETER; > } >=20 > NET_LIST_FOR_EACH (Entry, &Private->CacheList) { > Cache =3D NET_LIST_USER_STRUCT (Entry, HTTP_BOOT_CACHE_CONTENT, Link= ); > // > // Compare the URI to see whether we already have a cache for this > file. > // > if ((Cache->RequestData !=3D NULL) && > (Cache->RequestData->Url !=3D NULL) && > - (StrCmp (Uri, Cache->RequestData->Url) =3D=3D 0)) > - { > + (StrCmp (Uri, Cache->RequestData->Url) =3D=3D 0)) { > // > // Hit in cache, record image type. > // > *ImageType =3D Cache->ImageType; >=20 > @@ -945,11 +944,11 @@ HttpBootGetBootFile ( > Url =3D AllocatePool (UrlSize * sizeof (CHAR16)); > if (Url =3D=3D NULL) { > return EFI_OUT_OF_RESOURCES; > } > AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize); > - if (!HeaderOnly) { > + if (!HeaderOnly && Buffer !=3D NULL) { > Status =3D HttpBootGetFileFromCache (Private, Url, BufferSize, Buffe= r, > ImageType); > if (Status !=3D EFI_NOT_FOUND) { > FreePool (Url); > return Status; > } > @@ -1127,11 +1126,11 @@ HttpBootGetBootFile ( > Context.Buffer =3D Buffer; > Context.BufferSize =3D *BufferSize; > Context.Cache =3D Cache; > Context.Private =3D Private; > Status =3D HttpInitMsgParser ( > - HeaderOnly? HttpMethodHead : HttpMethodGet, > + HeaderOnly ? HttpMethodHead : HttpMethodGet, > ResponseData->Response.StatusCode, > ResponseData->HeaderCount, > ResponseData->Headers, > HttpBootGetBootFileCallback, > (VOID*) &Context, > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel