From 6cb4160e0c1de2562b40f30206f80f96303c1ee8 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 25 May 2025 17:59:45 -0400 Subject: cmd_list_journal: handle jset_entries with bad lengths Signed-off-by: Kent Overstreet --- c_src/cmd_list_journal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c_src/cmd_list_journal.c b/c_src/cmd_list_journal.c index 7b0008de..1f97bc85 100644 --- a/c_src/cmd_list_journal.c +++ b/c_src/cmd_list_journal.c @@ -222,7 +222,8 @@ static void journal_entries_print(struct bch_fs *c, unsigned nr_entries, struct jset_entry *entry = p->j.start; struct jset_entry *end = vstruct_last(&p->j); - while (entry != end) { + while (entry < end && + vstruct_next(entry) <= end) { /* * log entries denote the start of a new transaction -- cgit v1.2.3