efi_loader: fix possible buffer overflow

Variable "final" will have SHA512 digest, but currently
the array size is not sufficient. Let's fix it.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Masahisa Kojima 2021-04-14 11:55:49 +09:00 committed by Heinrich Schuchardt
parent e8287b0fb2
commit b1a7a5e0b8

View file

@ -515,7 +515,7 @@ static efi_status_t tcg2_create_digest(const u8 *input, u32 length,
sha1_context ctx;
sha256_context ctx_256;
sha512_context ctx_512;
u8 final[TPM2_ALG_SHA512];
u8 final[TPM2_SHA512_DIGEST_SIZE];
efi_status_t ret;
u32 active;
int i;