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.115; helo=mga14.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 C9ACA21962301 for ; Sun, 18 Nov 2018 18:08:50 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2018 18:08:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,250,1539673200"; d="scan'208";a="282210098" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga006.fm.intel.com with ESMTP; 18 Nov 2018 18:08:49 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Michael D Kinney , Liming Gao Date: Mon, 19 Nov 2018 10:08:33 +0800 Message-Id: <20181119020833.22748-2-dandan.bi@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20181119020833.22748-1-dandan.bi@intel.com> References: <20181119020833.22748-1-dandan.bi@intel.com> Subject: [patch] MdePkg: Check input Ptrs in GetSectionFromAnyFvByFileType X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:08:51 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1337 In function GetSectionFromAnyFvByFileType, the input parameter "Buffer" and "size" should not be NULL, so add ASSERT here to avoid any checker report that the NULL pointer may be used. Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- MdePkg/Library/DxeServicesLib/DxeServicesLib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c index d4f366425f..e78d51cb92 100644 --- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c +++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c @@ -251,10 +251,13 @@ GetSectionFromAnyFvByFileType ( UINTN Key; EFI_GUID NameGuid; EFI_FV_FILE_ATTRIBUTES Attributes; EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; + ASSERT (Buffer != NULL); + ASSERT (Size != NULL); + // // Locate all available FVs. // HandleBuffer = NULL; Status = gBS->LocateHandleBuffer ( -- 2.18.0.windows.1