diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-26 20:37:00 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-04-26 20:51:12 +0900 |
commit | bf9b7728e6e8eb185d2c9bfc6641077489384bc8 (patch) | |
tree | 08da70afe09eaaff60d5fbd03b23ad4cfbcc4041 /src/libsystemd | |
parent | 265b1dc04845788973ef95e80fae8db258a8c49a (diff) | |
download | systemd-bf9b7728e6e8eb185d2c9bfc6641077489384bc8.tar.gz |
sd-journal: copy boot ID
The pointer to boot ID may be invalidate by journal_file_move_to_object()
calls in the later loop.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-journal/journal-file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c index f14e7aa23d..e9bb893ca8 100644 --- a/src/libsystemd/sd-journal/journal-file.c +++ b/src/libsystemd/sd-journal/journal-file.c @@ -4169,7 +4169,7 @@ int journal_file_copy_entry( _cleanup_free_ EntryItem *items_alloc = NULL; EntryItem *items; uint64_t n, m = 0, xor_hash = 0; - const sd_id128_t *boot_id; + sd_id128_t boot_id; dual_timestamp ts; int r; @@ -4185,7 +4185,7 @@ int journal_file_copy_entry( .monotonic = le64toh(o->entry.monotonic), .realtime = le64toh(o->entry.realtime), }; - boot_id = &o->entry.boot_id; + boot_id = o->entry.boot_id; n = journal_file_entry_n_items(from, o); @@ -4246,7 +4246,7 @@ int journal_file_copy_entry( r = journal_file_append_entry_internal( to, &ts, - boot_id, + &boot_id, &from->header->machine_id, xor_hash, items, |