Summary: |
sd-journal: check if the pointers passed are the same |
Product: |
systemd
|
Reporter: |
Thomas H.P. Andersen <phomes> |
Component: |
general | Assignee: |
systemd-bugs |
Status: |
RESOLVED
FIXED
|
QA Contact: |
systemd-bugs |
Severity: |
trivial
|
|
|
Priority: |
medium
|
CC: |
phomes
|
Version: |
unspecified | |
|
Hardware: |
Other | |
|
OS: |
All | |
|
Whiteboard: |
|
i915 platform:
|
|
i915 features:
|
|
Attachments: |
Check that the passed pointers are not the same
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 68501 [details] Check that the passed pointers are not the same sd_journal_get_cutoff_realtime_usec(sd_journal* j, uint64_t* from, uint64_t* to) checks that the parameters 'to' and 'from' are not both null at the same time. That makes sense as it would not produce any result. Another way to get a bad result is if the same pointer is passed as both 'to' and 'from'. This is not a problem for any real code that I know of. I was just reading the docs and wondering what would happen. The attached patch adds a check for this in sd_journal_get_cutoff_realtime_usec and sd_journal_get_cutoff_monotonic_usec.