]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/journal/journal-file.c
journal: prevent integer overflow while validating header (#5569) 5496/head
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>
Mon, 13 Mar 2017 07:14:42 +0000 (08:14 +0100)
committerMartin Pitt <martinpitt@users.noreply.github.com>
Mon, 13 Mar 2017 07:14:42 +0000 (08:14 +0100)
commit6f94e420e8355421fc31713a0df760d6b20473ac
tree23ade59ba785d02c64ada0a17e936aaa54acbcb2
parent0e7d3682637e12e419c5a05b4bfa4d763fe6c3b8
journal: prevent integer overflow while validating header (#5569)

It is possible to overflow uint64_t while validating the header of
a journal file. To prevent this, the addition itself is checked to
be within the limits of UINT64_MAX first.

To keep this readable, I have introduced two stack variables which
hold the converted values during validation.
src/journal/journal-file.c