summaryrefslogtreecommitdiff
path: root/lib/tpm-common.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-07-16 09:15:59 -0400
committerTom Rini <trini@konsulko.com>2021-07-16 09:15:59 -0400
commitc39946a2e2d062025c9fc8b34587dfdd45fd8703 (patch)
tree30326b7ad7ab94a6c936506636cf93d63b300384 /lib/tpm-common.c
parentd0dab9336db08bf562dd7ded4a417efd8570cee7 (diff)
parent92cf458f8ad9410dedbedd41d048d26620ce5f12 (diff)
Merge branch '2021-07-15-assorted-fixes'
- Large number of Coverity reported issues addressed - m41t62 bugfix - Support more Android image compression formats - FIT + DTO bugfix
Diffstat (limited to 'lib/tpm-common.c')
-rw-r--r--lib/tpm-common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tpm-common.c b/lib/tpm-common.c
index 4277846fdd0..82ffdc5341b 100644
--- a/lib/tpm-common.c
+++ b/lib/tpm-common.c
@@ -176,6 +176,11 @@ u32 tpm_sendrecv_command(struct udevice *dev, const void *command,
}
size = tpm_command_size(command);
+
+ /* sanity check, which also helps coverity */
+ if (size > COMMAND_BUFFER_SIZE)
+ return log_msg_ret("size", -E2BIG);
+
log_debug("TPM request [size:%d]: ", size);
for (i = 0; i < size; i++)
log_debug("%02x ", ((u8 *)command)[i]);