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.43; helo=mga05.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 9BD842035686A for ; Tue, 21 Nov 2017 22:34:04 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2017 22:38:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="152032128" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 21 Nov 2017 22:38:19 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Nov 2017 22:38:19 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Nov 2017 22:38:18 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 22 Nov 2017 14:38:17 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" Thread-Topic: [Patch] NetworkPkg/HttpDxe: Fix the incorrect SizeofHeaders in HttpTcpReceiveHeader(). Thread-Index: AQHTY1whhVHc0txFIkKwKR67NSkc66Mf8jLg Date: Wed, 22 Nov 2017 06:38:16 +0000 Message-ID: References: <1511332535-5996-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1511332535-5996-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWYyZGQ4M2QtYjE0OS00OGQ5LTlkMjgtY2ZjNDBlNDc0MDRmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiIzOVFaWFNGbFlcL2dRbFQ2bUt3Y21hSE1WRHRnYThxV0pBY1wvNFEzZlJZQTRNU3NycUdsazRJS01Xb01vcldtU3gifQ== 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/HttpDxe: Fix the incorrect SizeofHeaders in HttpTcpReceiveHeader(). 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: Wed, 22 Nov 2017 06:34:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: Wu, Jiaxin > Sent: Wednesday, November 22, 2017 2:36 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [Patch] NetworkPkg/HttpDxe: Fix the incorrect SizeofHeaders in > HttpTcpReceiveHeader(). >=20 > Commit 19bd133562df951ae7ff7e1fff99b11a25b4cb6d is to fix the incorrect > SizeofHeaders > returned from HttpTcpReceiveHeader(). But it missed the "\r\n\r\n" > calculation, which > will cause the later HttpHeaders parsing failure. >=20 > This patch is fix the above issue. >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wu Jiaxin > --- > NetworkPkg/HttpDxe/HttpProto.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) >=20 > diff --git a/NetworkPkg/HttpDxe/HttpProto.c > b/NetworkPkg/HttpDxe/HttpProto.c > index 1aa1816..925281a 100644 > --- a/NetworkPkg/HttpDxe/HttpProto.c > +++ b/NetworkPkg/HttpDxe/HttpProto.c > @@ -1875,13 +1875,10 @@ HttpTcpReceiveHeader ( >=20 > // > // Check whether we received end of HTTP headers. > // > *EndofHeader =3D AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR); > - if (*EndofHeader !=3D NULL) { > - *SizeofHeaders =3D *EndofHeader - *HttpHeaders; > - } > }; >=20 > // > // Free the buffer. > // > @@ -1977,13 +1974,10 @@ HttpTcpReceiveHeader ( >=20 > // > // Check whether we received end of HTTP headers. > // > *EndofHeader =3D AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR); > - if (*EndofHeader !=3D NULL) { > - *SizeofHeaders =3D *EndofHeader - *HttpHeaders; > - } > }; >=20 > // > // Free the buffer. > // > @@ -2000,11 +1994,13 @@ HttpTcpReceiveHeader ( > } >=20 > // > // Skip the CRLF after the HTTP headers. > // > - *EndofHeader =3D *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR); > + *EndofHeader =3D *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR); > + > + *SizeofHeaders =3D *EndofHeader - *HttpHeaders; >=20 > return EFI_SUCCESS; > } >=20 > /** > -- > 1.9.5.msysgit.1