From nobody Sun Apr 28 21:57:46 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1530062330491377.3835022719155; Tue, 26 Jun 2018 18:18:50 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7804C202E53E8; Tue, 26 Jun 2018 18:18:49 -0700 (PDT) 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 4AB8E202E5302 for ; Tue, 26 Jun 2018 18:18:48 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2018 18:18:47 -0700 Received: from sfu5-mobl.ccr.corp.intel.com ([10.239.192.241]) by orsmga002.jf.intel.com with ESMTP; 26 Jun 2018 18:18:47 -0700 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=siyuan.fu@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.51,277,1526367600"; d="scan'208";a="70281414" From: Fu Siyuan To: edk2-devel@lists.01.org Date: Wed, 27 Jun 2018 09:18:41 +0800 Message-Id: <20180627011841.13028-1-siyuan.fu@intel.com> X-Mailer: git-send-email 2.13.0.windows.1 Subject: [edk2] [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , 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" Cc: Ye Ting Cc: Wu Jiaxin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Wu Jiaxin --- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg= /Universal/Network/Ip4Dxe/Ip4Impl.c index 5a9d828703..6a26143e30 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -1048,11 +1048,8 @@ Ip4Groups ( // is decreamented each time an address is removed.. // for (Index =3D IpInstance->GroupCount; Index > 0 ; Index--) { - Group =3D 0; =09 - if(IpInstance->Groups !=3D NULL) { - Group =3D IpInstance->Groups[Index - 1]; - } - =09 + ASSERT (IpInstance->Groups !=3D NULL); + Group =3D IpInstance->Groups[Index - 1]; if ((GroupAddress =3D=3D NULL) || EFI_IP4_EQUAL (&Group, GroupAddress)= ) { if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group)))) { return EFI_DEVICE_ERROR; --=20 2.13.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel