]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-verify: fix offset reported for tail hash mismatch
authordongshengyuan <545258830@qq.com>
Mon, 29 Jun 2026 06:53:35 +0000 (14:53 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 29 Jun 2026 08:46:03 +0000 (17:46 +0900)
After walking a hash chain, the loop exits with p == 0. The error()
call for a tail_hash_offset mismatch passed p as the file offset,
printing 0000000000000000 instead of the actual last data object.

Pass 'last' instead, which holds the offset of the final chain entry.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
src/libsystemd/sd-journal/journal-verify.c

index dd3b6f32d49e925e864a97c47a7b9e0b67756ff2..d214a68e686676b02e5fe11f736b5e86c23629a0 100644 (file)
@@ -590,7 +590,7 @@ static int verify_data_hash_table(
                 }
 
                 if (last != le64toh(f->data_hash_table[i].tail_hash_offset)) {
-                        error(p,
+                        error(last,
                               "Tail hash pointer mismatch in hash table (%"PRIu64" != %"PRIu64")",
                               last,
                               le64toh(f->data_hash_table[i].tail_hash_offset));