SecurityPkg: fix possible out of bond array access in debug traces

This patch fixes
https://github.com/tianocore/edk2/issues/10533
Bugzilla #4834

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
This commit is contained in:
Mike Maslenkin
2025-01-19 02:46:02 +03:00
committed by mergify[bot]
parent 9224a2b917
commit 55a887297c
2 changed files with 2 additions and 2 deletions

View File

@ -426,7 +426,7 @@ Tpm12TisTpmCommand (
Exit:
DEBUG_CODE_BEGIN ();
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Receive - "));
for (Index = 0; Index < TpmOutSize; Index++) {
for (Index = 0; Index < *SizeOut; Index++) {
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
}

View File

@ -397,7 +397,7 @@ Tpm2TisTpmCommand (
Exit:
DEBUG_CODE_BEGIN ();
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Receive - "));
for (Index = 0; Index < TpmOutSize; Index++) {
for (Index = 0; Index < *SizeOut; Index++) {
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
}