diff options
author | Marc-Andr? Lureau <marcandre.lureau@redhat.com> | 2018-03-07 04:27:18 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-03-07 21:46:11 +0800 |
commit | 4cc2b63bd829426b05bad0d8952f1855a10d6ed7 (patch) | |
tree | 26a6a81732ded848a8905117782253d6c5301a3b /SecurityPkg/Library/HashLibBaseCryptoRouter | |
parent | 7db1458f759c2e22ebb4c66bc61aa5dbae1e5fa1 (diff) | |
download | edk2-4cc2b63bd829426b05bad0d8952f1855a10d6ed7.tar.gz edk2-4cc2b63bd829426b05bad0d8952f1855a10d6ed7.tar.bz2 edk2-4cc2b63bd829426b05bad0d8952f1855a10d6ed7.zip |
SecurityPkg: only clear HashInterface information
The ZeroMem() call goes beyond the HashInterfaceHob structure, causing
HOB list corruption. Instead, just clear the HashInterface fields, as
I suppose was originally intended.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'SecurityPkg/Library/HashLibBaseCryptoRouter')
-rw-r--r-- | SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c b/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c index dbee0f2531..361a4f6508 100644 --- a/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c +++ b/SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c @@ -424,7 +424,8 @@ HashLibBaseCryptoRouterPeiConstructor ( // This is the second execution of this module, clear the hash interface
// information registered at its first execution.
//
- ZeroMem (&HashInterfaceHob->HashInterface, sizeof (*HashInterfaceHob) - sizeof (EFI_GUID));
+ ZeroMem (&HashInterfaceHob->HashInterface, sizeof (HashInterfaceHob->HashInterface));
+ HashInterfaceHob->HashInterfaceCount = 0;
}
//
|