From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 C170F210D512B for ; Wed, 1 Aug 2018 18:22:44 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2018 18:22:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,434,1526367600"; d="scan'208";a="59007182" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 01 Aug 2018 18:22:44 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 1 Aug 2018 18:22:44 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 1 Aug 2018 18:22:43 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.81]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Thu, 2 Aug 2018 09:22:42 +0800 From: "Wu, Hao A" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" Thread-Topic: [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffers Thread-Index: AQHUKf50n7Q7u+jUO0uvEEGQNwEUoKSrqoSw Date: Thu, 2 Aug 2018 01:22:42 +0000 Message-ID: References: <1533172589-24520-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1533172589-24520-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 01:22:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Zeng, Star > Sent: Thursday, August 02, 2018 9:16 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star; Yao, Jiewen; Wu, Hao A > Subject: [PATCH] MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the > return buffers >=20 > Add NULL check to the return buffers from GetFmpHandleBufferByType(). >=20 > Cc: Jiewen Yao > Cc: Hao A Wu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > index 85848279d44c..91c6849a4658 100644 > --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c > @@ -1225,7 +1225,9 @@ ProcessFmpCapsuleImage ( > &HandleBuffer, > &ResetRequiredBuffer > ); > - if (EFI_ERROR(Status)) { > + if (EFI_ERROR(Status) || > + (HandleBuffer =3D=3D NULL) || > + (ResetRequiredBuffer =3D=3D NULL)) { > NotReady =3D TRUE; > RecordFmpCapsuleStatus ( > NULL, > -- > 2.7.0.windows.1