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.88; helo=mga01.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org 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 8DFCD21B00DD0 for ; Tue, 14 Nov 2017 21:51:54 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2017 21:56:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,398,1505804400"; d="scan'208";a="176366838" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 14 Nov 2017 21:56:02 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 14 Nov 2017 21:56:01 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 14 Nov 2017 21:56:01 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 15 Nov 2017 13:55:59 +0800 From: "Wu, Jiaxin" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , Karunakar P Thread-Topic: [Patch] NetworkPkg: Fix incorrect SizeofHeaders returned from HttpTcpReceiveHeader(). Thread-Index: AQHTXbx/LSZPb4WwJUK/E1bOdXKRN6MU8Usg Date: Wed, 15 Nov 2017 05:55:59 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416347053@SHSMSX103.ccr.corp.intel.com> References: <20171115024521.27596-1-siyuan.fu@intel.com> In-Reply-To: <20171115024521.27596-1-siyuan.fu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTFjZjdiZWItODRmMy00N2ZkLTkzN2UtMDZlMTU0MjA4NWRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InFsOE1jR09YNWh0NlwvdVIxN1wvSFc0a2JFVmVwOHlWYmdxY3JMK0VMbVRndz0ifQ== x-ctpclassification: CTP_IC 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: Fix incorrect SizeofHeaders returned from 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, 15 Nov 2017 05:51:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin > -----Original Message----- > From: Fu, Siyuan > Sent: Wednesday, November 15, 2017 10:45 AM > To: edk2-devel@lists.01.org > Cc: Wu, Jiaxin ; Ye, Ting ; > Karunakar P > Subject: [Patch] NetworkPkg: Fix incorrect SizeofHeaders returned from > HttpTcpReceiveHeader(). >=20 > This patch is to fix a bug that the HttpTcpReceiveHeader() may return > incorrect > SizeofHeaders, which will include some already received message-body. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan > Cc: Wu Jiaxin > Cc: Ye Ting > Cc: Karunakar P > --- > NetworkPkg/HttpDxe/HttpProto.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/NetworkPkg/HttpDxe/HttpProto.c > b/NetworkPkg/HttpDxe/HttpProto.c > index ab00f3d..1aa1816 100644 > --- a/NetworkPkg/HttpDxe/HttpProto.c > +++ b/NetworkPkg/HttpDxe/HttpProto.c > @@ -1876,7 +1876,10 @@ HttpTcpReceiveHeader ( > // > // Check whether we received end of HTTP headers. > // > - *EndofHeader =3D AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR); > + *EndofHeader =3D AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR); > + if (*EndofHeader !=3D NULL) { > + *SizeofHeaders =3D *EndofHeader - *HttpHeaders; > + } > }; >=20 > // > @@ -1976,6 +1979,9 @@ HttpTcpReceiveHeader ( > // 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 > // > -- > 1.9.5.msysgit.1