mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
sd-journal: data object may be invalid after data_object_in_hash_table()
Fixes a bug introduced by 578cd1855b.
The function `data_object_in_hash_table()` calls
`journal_file_move_to_object()` with `OBJECT_DATA`. Hence,
previously obtained pointer to a data object may be now invalid.
Fixes #23794.
This commit is contained in:
@@ -670,6 +670,11 @@ static int verify_entry(
|
||||
return -EBADMSG;
|
||||
}
|
||||
|
||||
/* Pointer might have moved, reposition */
|
||||
r = journal_file_move_to_object(f, OBJECT_DATA, q, &u);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = journal_file_move_to_entry_by_offset_for_data(f, u, p, DIRECTION_DOWN, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user