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.65; helo=mga03.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 AA2A820945BA7 for ; Wed, 11 Oct 2017 21:22:30 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2017 21:25:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,364,1503385200"; d="scan'208";a="1181129256" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by orsmga001.jf.intel.com with ESMTP; 11 Oct 2017 21:25:54 -0700 From: Liming Gao To: edk2-devel@lists.01.org Cc: Wu Hao A Date: Thu, 12 Oct 2017 12:25:49 +0800 Message-Id: <1507782349-13060-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 04:22:30 -0000 This is the regression issue. After apply CalculateCrc32(), the parameter check is missing. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Wu Hao A --- MdeModulePkg/Core/RuntimeDxe/Crc32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Core/RuntimeDxe/Crc32.c b/MdeModulePkg/Core/RuntimeDxe/Crc32.c index 3e91e08..c271856 100644 --- a/MdeModulePkg/Core/RuntimeDxe/Crc32.c +++ b/MdeModulePkg/Core/RuntimeDxe/Crc32.c @@ -42,6 +42,10 @@ RuntimeDriverCalculateCrc32 ( OUT UINT32 *CrcOut ) { + if (Data == NULL || DataSize == 0 || CrcOut == NULL) { + return EFI_INVALID_PARAMETER; + } + *CrcOut = CalculateCrc32 (Data, DataSize); return EFI_SUCCESS; } -- 2.8.0.windows.1