mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
sd-journal: re-read entry array object
`test_object()` may call `journal_file_move_to_object()` and thus the `array` object may be invalidated.
This commit is contained in:
parent
03fdf95714
commit
e562f13158
|
@ -2975,8 +2975,16 @@ found:
|
||||||
if (subtract_one && t == 0 && i == 0)
|
if (subtract_one && t == 0 && i == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
r = journal_file_move_to_object(f, OBJECT_ENTRY_ARRAY, a, &array);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
|
p = journal_file_entry_array_item(f, array, 0);
|
||||||
|
if (p <= 0)
|
||||||
|
return -EBADMSG;
|
||||||
|
|
||||||
/* Let's cache this item for the next invocation */
|
/* Let's cache this item for the next invocation */
|
||||||
chain_cache_put(f->chain_cache, ci, first, a, journal_file_entry_array_item(f, array, 0), t, subtract_one ? (i > 0 ? i-1 : UINT64_MAX) : i);
|
chain_cache_put(f->chain_cache, ci, first, a, p, t, subtract_one ? (i > 0 ? i-1 : UINT64_MAX) : i);
|
||||||
|
|
||||||
if (subtract_one && i == 0)
|
if (subtract_one && i == 0)
|
||||||
p = last_p;
|
p = last_p;
|
||||||
|
|
Loading…
Reference in a new issue