From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 E6483211F886C for ; Thu, 28 Jun 2018 00:13:37 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 00:13:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,282,1526367600"; d="scan'208";a="67003765" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 28 Jun 2018 00:13:37 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Jun 2018 00:13:37 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Jun 2018 00:13:36 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.82]) with mapi id 14.03.0319.002; Thu, 28 Jun 2018 15:13:34 +0800 From: "Wu, Jiaxin" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Ye, Ting" Thread-Topic: [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using. Thread-Index: AQHUDbTRuPT/gTDISUuzQMOR6n8xyKR1Q4lQ Date: Thu, 28 Jun 2018 07:13:34 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B72741645A913@SHSMSX103.ccr.corp.intel.com> References: <20180627011841.13028-1-siyuan.fu@intel.com> In-Reply-To: <20180627011841.13028-1-siyuan.fu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjg2OGU4MjAtZTQ4Zi00YjBjLWIwZjEtZGMwYThjYjhlNmQyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRXNFdE1wTk9aY3FqcTcxRFwvcHdrcHh0RjJEOVwvdkpCbE5LUGVQaEQ1dW45YTIwYWFZOHFHTVhuRlJaeTlDNWpxIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 28 Jun 2018 07:13:38 -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, June 27, 2018 9:19 AM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Wu, Jiaxin > Subject: [Patch] MdeModulePkg: Update IP4 driver to check for NULL > pointer before using. >=20 > Cc: Ye Ting > Cc: Wu Jiaxin > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan > --- > MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) >=20 > 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; > - if(IpInstance->Groups !=3D NULL) { > - Group =3D IpInstance->Groups[Index - 1]; > - } > - > + ASSERT (IpInstance->Groups !=3D NULL); > + Group =3D IpInstance->Groups[Index - 1]; > if ((GroupAddress =3D=3D NULL) || EFI_IP4_EQUAL (&Group, GroupAddres= s)) { > if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group)))) { > return EFI_DEVICE_ERROR; > -- > 2.13.0.windows.1