From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 5301B81D81 for ; Sun, 20 Nov 2016 23:57:57 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2016 23:57:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,674,1473145200"; d="scan'208";a="33896490" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 20 Nov 2016 23:57:57 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 20 Nov 2016 23:57:56 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 20 Nov 2016 23:57:56 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.142]) with mapi id 14.03.0248.002; Mon, 21 Nov 2016 15:57:54 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH v2] MdeModulePkg CapsuleApp: ASSERT to ensure 'CapsuleIndex' is not NULL Thread-Index: AQHSQ8v7+ygFvZ417kmIDosBo/scJaDjEkjg Date: Mon, 21 Nov 2016 07:57:53 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386D814B@shsmsx102.ccr.corp.intel.com> References: <1479714624-8356-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1479714624-8356-1-git-send-email-hao.a.wu@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 v2] MdeModulePkg CapsuleApp: ASSERT to ensure 'CapsuleIndex' is not NULL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 07:57:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: jiewen.yao@intel.com > -----Original Message----- > From: Wu, Hao A > Sent: Monday, November 21, 2016 3:50 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Yao, Jiewen > Subject: [PATCH v2] MdeModulePkg CapsuleApp: ASSERT to ensure > 'CapsuleIndex' is not NULL >=20 > Function GetVariable2() ensures its third (output) parameter will not be > NULL when the return status is EFI_SUCCESS. >=20 > This commit adds ASSERT as warnings for the case that will not happen. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > --- > MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c > b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c > index 9291ba3..d09b938 100644 > --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c > +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c > @@ -285,6 +285,7 @@ DmpCapsuleStatusVariable ( > NULL > ); > if (!EFI_ERROR(Status)) { > + ASSERT (CapsuleIndex !=3D NULL); > CopyMem(CapsuleIndexData, CapsuleIndex, 11 * sizeof(CHAR16)); > CapsuleIndexData[11] =3D 0; > Print(L"CapsuleMax - %s\n", CapsuleIndexData); > @@ -297,6 +298,7 @@ DmpCapsuleStatusVariable ( > NULL > ); > if (!EFI_ERROR(Status)) { > + ASSERT (CapsuleIndex !=3D NULL); > CopyMem(CapsuleIndexData, CapsuleIndex, 11 * sizeof(CHAR16)); > CapsuleIndexData[11] =3D 0; > Print(L"CapsuleLast - %s\n", CapsuleIndexData); > -- > 1.9.5.msysgit.0