<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - sd-journal: check if the pointers passed are the same"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55936">55936</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>sd-journal: check if the pointers passed are the same
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>trivial
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>phomes@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=68501" name="attach_68501" title="Check that the passed pointers are not the same">attachment 68501</a> <a href="attachment.cgi?id=68501&action=edit" title="Check that the passed pointers are not the same">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>