summaryrefslogtreecommitdiffstats
path: root/src/security/tpm/tspi/log-tpm1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/security/tpm/tspi/log-tpm1.c')
-rw-r--r--src/security/tpm/tspi/log-tpm1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/security/tpm/tspi/log-tpm1.c b/src/security/tpm/tspi/log-tpm1.c
index 529442630445..3b192d706955 100644
--- a/src/security/tpm/tspi/log-tpm1.c
+++ b/src/security/tpm/tspi/log-tpm1.c
@@ -170,6 +170,11 @@ void tpm1_log_copy_entries(const void *from, void *to)
int i;
for (i = 0; i < le16toh(from_log->vendor.num_entries); i++) {
+ if (le16toh(to_log->vendor.num_entries) >= le16toh(to_log->vendor.max_entries)) {
+ printk(BIOS_WARNING, "TPM LOG: log table is full\n");
+ return;
+ }
+
struct tpm_1_log_entry *tce =
&to_log->entries[le16toh(to_log->vendor.num_entries)];
memcpy(tce, &from_log->entries[i], sizeof(*tce));