From nobody Wed May 14 09:52:43 2025 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 15139264457081014.1609961843164; Thu, 21 Dec 2017 23:07:25 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 15439222CB315; Thu, 21 Dec 2017 23:02:35 -0800 (PST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 8284E222CB30D for ; Thu, 21 Dec 2017 23:02:32 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 23:07:22 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.141]) by fmsmga002.fm.intel.com with ESMTP; 21 Dec 2017 23:07:21 -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.100; helo=mga07.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,439,1508828400"; d="scan'208";a="3965855" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Fri, 22 Dec 2017 15:07:17 +0800 Message-Id: <1513926438-4160-2-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1513926438-4160-1-git-send-email-jiaxin.wu@intel.com> References: <1513926438-4160-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 1/3] NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use 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: , Cc: Ye Ting , Wang Fan , 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" According the Spec, the FragmentBuffers in FragmentTable are allocated by the application when calling Receive() function. This patch is to check whether the FragmentBuffer is valid or not. Cc: Fu Siyuan Cc: Wang Fan Cc: Ye Ting Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/TcpDxe/TcpMain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c index fc3713e..e349d2d 100644 --- a/NetworkPkg/TcpDxe/TcpMain.c +++ b/NetworkPkg/TcpDxe/TcpMain.c @@ -38,10 +38,13 @@ TcpChkDataBuf ( UINT32 Index; =20 UINT32 Len; =20 for (Index =3D 0, Len =3D 0; Index < FragmentCount; Index++) { + if (FragmentTable[Index].FragmentBuffer =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } Len =3D Len + FragmentTable[Index].FragmentLength; } =20 if (DataLen !=3D Len) { return EFI_INVALID_PARAMETER; --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel