From fdf12edd853adc52c6e4f971c5ae1b02223cd925 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 3 Jul 2026 11:33:19 +0200 Subject: [PATCH] imv-attestation: Fix log message when failing to store file measurement Also fixes a double free in that case (the `break` only leaves the loop, not the switch statement). Fixes: 076aac70693d ("imv-attestation: Fixed file hash measurements") --- .../plugins/imv_attestation/imv_attestation_process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libimcv/plugins/imv_attestation/imv_attestation_process.c b/src/libimcv/plugins/imv_attestation/imv_attestation_process.c index cfef7de91..61ad315f0 100644 --- a/src/libimcv/plugins/imv_attestation/imv_attestation_process.c +++ b/src/libimcv/plugins/imv_attestation/imv_attestation_process.c @@ -319,6 +319,7 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg, enumerator_t *e; char *filename; chunk_t measurement; + bool added = TRUE; int vid; if (!pts_db->get_product_version(pts_db, @@ -335,13 +336,14 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg, measurement, filename, is_dir, arg_int)) { eval = TNC_IMV_EVALUATION_RESULT_ERROR; - e->destroy(e); + added = FALSE; break; } } e->destroy(e); snprintf(result_str, BUF_LEN, "%s reference measurement " - "successful", is_dir ? "directory" : "file"); + "%s", is_dir ? "directory" : "file", + added ? "successful" : "failed"); break; } default: