From 11b1c1d4b98bc1b5eaaaf9eaa94ecd34eeaba5f9 Mon Sep 17 00:00:00 2001 From: Scottie Kuo Date: Fri, 21 May 2021 15:44:30 +0800 Subject: SecurityPkg: TcgStorageOpalLib: Initialize SupportedAttributes parameter. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3408 The value of SupportedAttributes in OpalGetSupportedAttributesInfo () is left undetermined, if the caller doesn't initialize it. Initialize it in the function entry. Signed-off-by: Scottie Kuo Cc: Qi Zhang Cc: Rahul Kumar Cc: Jiewen Yao Cc: Maggie Chu Reviewed-by: Jiewen Yao Acked-by: Jian J Wang --- SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c index b58597e61f..c840590e8e 100644 --- a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c +++ b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalCore.c @@ -1,7 +1,7 @@ /** @file Public API for Opal Core library. -Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1647,6 +1647,7 @@ OpalGetSupportedAttributesInfo( NULL_CHECK(OpalBaseComId); ZeroMem(Buffer, BUFFER_SIZE); + ZeroMem(SupportedAttributes, sizeof(OPAL_DISK_SUPPORT_ATTRIBUTE)); ASSERT(sizeof(Buffer) >= sizeof(TCG_SUPPORTED_SECURITY_PROTOCOLS)); // -- cgit v1.2.3