When a journal file is removed or corrupted, then the value `p`, which is
read from Object.data.entry_offset, may be zero.
Note, journal_file_move_to_object() checks the passed offset and return
-EBADMSG if it is invalid.
Fixes the issue reported at
https://github.com/systemd/systemd/pull/40372#issuecomment-
3762907261.
static int test_object_offset(JournalFile *f, uint64_t p, uint64_t needle) {
assert(f);
- assert(p > 0);
+
+ if (p <= 0)
+ return -EBADMSG;
if (p == needle)
return TEST_FOUND;
int r;
assert(f);
- assert(p > 0);
r = journal_file_move_to_object(f, OBJECT_ENTRY, p, &o);
if (r < 0)
int r;
assert(f);
- assert(p > 0);
r = journal_file_move_to_object(f, OBJECT_ENTRY, p, &o);
if (r < 0)
int r;
assert(f);
- assert(p > 0);
r = journal_file_move_to_object(f, OBJECT_ENTRY, p, &o);
if (r < 0)