From nobody Sun May 5 06:14:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 1510714228509359.9221811249371; Tue, 14 Nov 2017 18:50:28 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1E85D2034BBF6; Tue, 14 Nov 2017 18:46:19 -0800 (PST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 51B8C220D4C07 for ; Tue, 14 Nov 2017 18:46:18 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2017 18:50:26 -0800 Received: from sfu5-mobl.ccr.corp.intel.com ([10.239.192.240]) by fmsmga006.fm.intel.com with ESMTP; 14 Nov 2017 18:50:24 -0800 X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,397,1505804400"; d="scan'208";a="176323627" From: Fu Siyuan To: edk2-devel@lists.01.org Date: Wed, 15 Nov 2017 10:45:21 +0800 Message-Id: <20171115024521.27596-1-siyuan.fu@intel.com> X-Mailer: git-send-email 2.13.0.windows.1 Subject: [edk2] [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: , Cc: Ye Ting , Karunakar P , 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" This patch is to fix a bug that the HttpTcpReceiveHeader() may return incor= rect SizeofHeaders, which will include some already received message-body. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Cc: Wu Jiaxin Cc: Ye Ting Cc: Karunakar P Reviewed-by: Wu Jiaxin Reviewed-by: Ye Ting =20 --- NetworkPkg/HttpDxe/HttpProto.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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);=20 + *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);=20 + if (*EndofHeader !=3D NULL) { + *SizeofHeaders =3D *EndofHeader - *HttpHeaders; + } }; =20 // --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel