From 43d695af601cf6e80538fcde2a1f4f7a39381551 Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Tue, 11 Aug 2020 11:22:40 +0200 Subject: [PATCH] Fix item count calculation of the logs array in yh_com_audit The variable logs is not a byte array and its item count should be calculated in the correct way. --- src/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands.c b/src/commands.c index eefac8c2..fda8ffe8 100644 --- a/src/commands.c +++ b/src/commands.c @@ -70,7 +70,7 @@ int yh_com_audit(yubihsm_context *ctx, Argument *argv, cmd_format fmt) { uint16_t unlogged_boot = 0; uint16_t unlogged_auth = 0; yh_log_entry logs[YH_MAX_LOG_ENTRIES]; - size_t n_items = sizeof(logs); + size_t n_items = sizeof(logs) / sizeof(logs[0]); switch (fmt) { case fmt_binary: