summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-05-25 17:59:45 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-25 17:59:45 -0400
commit6cb4160e0c1de2562b40f30206f80f96303c1ee8 (patch)
tree23746a0fea20a4043d0dc81fad3cc3ee2dbd746b
parent241bcd01833274da114b709d2f2b13d4429c7fd9 (diff)
cmd_list_journal: handle jset_entries with bad lengths
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--c_src/cmd_list_journal.c3
1 files changed, 2 insertions, 1 deletions
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