From nobody Sun May 5 22:04:08 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 151133254117710.244683632089163; Tue, 21 Nov 2017 22:35:41 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 17A3B21B00DD6; Tue, 21 Nov 2017 22:31:24 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 C987E2035686A for ; Tue, 21 Nov 2017 22:31:22 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2017 22:35:38 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.34]) by orsmga003.jf.intel.com with ESMTP; 21 Nov 2017 22:35:36 -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.65; helo=mga03.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="5078546" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Wed, 22 Nov 2017 14:35:35 +0800 Message-Id: <1511332535-5996-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [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: , Cc: Ye Ting , Fu Siyuan , 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" Commit 19bd133562df951ae7ff7e1fff99b11a25b4cb6d is to fix the incorrect Siz= eofHeaders returned from HttpTcpReceiveHeader(). But it missed the "\r\n\r\n" calculat= ion, which will cause the later HttpHeaders parsing failure. This patch is fix the above issue. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/HttpDxe/HttpProto.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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);=20 - if (*EndofHeader !=3D NULL) { - *SizeofHeaders =3D *EndofHeader - *HttpHeaders; - } }; =20 // // Free the buffer. // @@ -2000,11 +1994,13 @@ HttpTcpReceiveHeader ( } =20 =20 // // Skip the CRLF after the HTTP headers. // - *EndofHeader =3D *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR); =20 + *EndofHeader =3D *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR); + + *SizeofHeaders =3D *EndofHeader - *HttpHeaders; =20 return EFI_SUCCESS; } =20 /** --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel