From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: zailiang.sun@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Wed, 10 Jul 2019 21:53:22 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 21:53:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,476,1557212400"; d="scan'208";a="171126550" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 10 Jul 2019 21:53:21 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 21:53:20 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 21:53:20 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by shsmsx102.ccr.corp.intel.com ([169.254.2.3]) with mapi id 14.03.0439.000; Thu, 11 Jul 2019 12:53:18 +0800 From: "Sun, Zailiang" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Qian, Yi" , Gary Lin Subject: Re: [edk2-platforms Patch 17/28] Vlvt2TbltDevicePkg: Fix NULL pointer access in SmbiosMiscDxe Thread-Topic: [edk2-platforms Patch 17/28] Vlvt2TbltDevicePkg: Fix NULL pointer access in SmbiosMiscDxe Thread-Index: AQHVN1J4wgJ7sIkMUU+ThoEJT4ia86bE2lAA Date: Thu, 11 Jul 2019 04:53:18 +0000 Message-ID: <7CB7EF03E15B5D48981329A508747A9850C95E12@SHSMSX104.ccr.corp.intel.com> References: <20190710190516.6012-1-michael.d.kinney@intel.com> <20190710190516.6012-18-michael.d.kinney@intel.com> In-Reply-To: <20190710190516.6012-18-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zailiang.sun@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-By: Zailiang Sun > -----Original Message----- > From: Kinney, Michael D > Sent: Thursday, July 11, 2019 3:05 AM > To: devel@edk2.groups.io > Cc: Sun, Zailiang ; Qian, Yi ; > Gary Lin > Subject: [edk2-platforms Patch 17/28] Vlvt2TbltDevicePkg: Fix NULL pointe= r > access in SmbiosMiscDxe >=20 > Handle case where no Simple Network Protocols are found. >=20 > Cc: Zailiang Sun > Cc: Yi Qian > Cc: Gary Lin > Signed-off-by: Michael D Kinney > --- > .../MiscBaseBoardManufacturerFunction.c | 14 +++++++++----- > .../SmBiosMiscDxe/MiscSystemManufacturerFunction.c | 14 +++++++++---- > - > 2 files changed, 18 insertions(+), 10 deletions(-) >=20 > diff --git > a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufa > cturerFunction.c > b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufa > cturerFunction.c > index 4e02486853..8eddc5c2a6 100644 > --- > a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufa > cturerFunction.c > +++ > b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufa > cturerFunction.c > @@ -130,11 +130,15 @@ > MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer) > // > //Get the MAC string > // > - Status =3D NetLibGetMacString ( > - *Handles, > - NULL, > - &MacStr > - ); > + if (Handles =3D=3D NULL) { > + Status =3D EFI_NOT_FOUND; > + } else { > + Status =3D NetLibGetMacString ( > + *Handles, > + NULL, > + &MacStr > + ); > + } > if (EFI_ERROR (Status)) { > MacStr =3D L"000000000000"; > } > diff --git > a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufactu > rerFunction.c > b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufactu > rerFunction.c > index da660cb3a8..b18dbd6ae2 100644 > --- > a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufactu > rerFunction.c > +++ > b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufactu > rerFunction.c > @@ -212,11 +212,15 @@ AddSmbiosManuCallback ( > // > //Get the MAC string > // > - Status =3D NetLibGetMacString ( > - *Handles, > - NULL, > - &MacStr > - ); > + if (Handles =3D=3D NULL) { > + Status =3D EFI_NOT_FOUND; > + } else { > + Status =3D NetLibGetMacString ( > + *Handles, > + NULL, > + &MacStr > + ); > + } > if (EFI_ERROR (Status)) { > MacStr =3D L"000000000000"; > } > -- > 2.21.0.windows.1