sd-journal: introduce simple loop detection for entry array objects
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 May 2023 05:18:08 +0000 (14:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 May 2023 06:46:59 +0000 (15:46 +0900)
commita8fbcc0e3c033a43e511550052cace6b0dcf3df7
treea62cec0597ef86818cf3c3fccc4b0e6ba90d9ee2
parente758735d330044402826ac2e8c2a0814b02fec92
sd-journal: introduce simple loop detection for entry array objects

If .next_entry_array_offset points to one of the previous entry or the
self entry, then the loop for entry array objects may run infinitely.
Let's assume that the offsets of each entry array object are in
increasing order, and check that in loop.

Fixes #27470.
src/libsystemd/sd-journal/journal-file.c