]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: add assert for max_size overflow safety
authorLuca Boccassi <luca.boccassi@gmail.com>
Sat, 28 Mar 2026 20:59:35 +0000 (20:59 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 30 Mar 2026 08:37:31 +0000 (09:37 +0100)
commit4ff8fb899ba94e7b197f8c55a7797adb648791b4
tree7c14b6dbf3a4d4da42e895a6be81c45dced4316a
parent566a4f3437d44e25ea4f1175c14a9bf90ffd230b
journal: add assert for max_size overflow safety

Coverity flags max_size*2 as a potential overflow. The value is
bounded by MAX_SIZE_UPPER (128 MiB) or JOURNAL_COMPACT_SIZE_MAX
(4 GiB), so doubling is safe within uint64_t. Add an assert to
document this.

CID#1548019

Follow-up for 8580d1f73db36e9383e674e388b4fb55828c0c66
src/libsystemd/sd-journal/journal-file.c