mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-26 17:25:34 +03:00
journal: refuse skip parameter for sd_journal_next_skip() larger than INT_MAX
Fixes #17502.
(cherry picked from commit 41d544a1c1
)
This commit is contained in:
parent
bcd4d3ec35
commit
6b9e8618e5
@ -78,9 +78,9 @@
|
||||
the read pointer back one entry.</para>
|
||||
|
||||
<para><function>sd_journal_next_skip()</function> and
|
||||
<function>sd_journal_previous_skip()</function> advance/set back
|
||||
the read pointer by multiple entries at once, as specified in the
|
||||
<varname>skip</varname> parameter.</para>
|
||||
<function>sd_journal_previous_skip()</function> advance/set back the read pointer by multiple
|
||||
entries at once, as specified in the <varname>skip</varname> parameter. The <varname>skip</varname>
|
||||
parameter must be less than or equal to 2147483647 (2^31-1).</para>
|
||||
|
||||
<para>The journal is strictly ordered by reception time, and hence
|
||||
advancing to the next entry guarantees that the entry then
|
||||
|
@ -884,6 +884,7 @@ static int real_journal_next_skip(sd_journal *j, direction_t direction, uint64_t
|
||||
|
||||
assert_return(j, -EINVAL);
|
||||
assert_return(!journal_pid_changed(j), -ECHILD);
|
||||
assert_return(skip <= INT_MAX, -ERANGE);
|
||||
|
||||
if (skip == 0) {
|
||||
/* If this is not a discrete skip, then at least
|
||||
|
Loading…
Reference in New Issue
Block a user