[systemd-bugs] [Bug 55936] New: sd-journal: check if the pointers passed are the same

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Oct 12 11:38:18 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=55936

          Priority: medium
            Bug ID: 55936
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: sd-journal: check if the pointers passed are the same
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: trivial
    Classification: Unclassified
                OS: All
          Reporter: phomes at gmail.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

Created attachment 68501
  --> https://bugs.freedesktop.org/attachment.cgi?id=68501&action=edit
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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20121012/4971a989/attachment.html>


More information about the systemd-bugs mailing list