cmd_list_journal: handle jset_entries with bad lengths
Some checks failed
build / bcachefs-tools-deb (ubuntu-22.04) (push) Has been cancelled
Nix Flake actions / nix-matrix (push) Has been cancelled
build / bcachefs-tools-deb (ubuntu-24.04) (push) Has been cancelled
build / bcachefs-tools-rpm (push) Has been cancelled
build / bcachefs-tools-msrv (push) Has been cancelled
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Has been cancelled

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-05-25 17:59:45 -04:00
parent 241bcd0183
commit 6cb4160e0c

View File

@ -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