[systemd-commits] src/journal

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Tue May 14 18:55:37 PDT 2013


 src/journal/sd-journal.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 39887731d4a36292674f92effa30e5941419c201
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri Oct 12 20:26:47 2012 +0200

    sd-journal: check if the pointers passed are the same

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index c21712b..779af62 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -2217,6 +2217,8 @@ _public_ int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from,
                 return -EINVAL;
         if (!from && !to)
                 return -EINVAL;
+        if (from == to)
+                return -EINVAL;
 
         HASHMAP_FOREACH(f, j->files, i) {
                 usec_t fr, t;
@@ -2256,6 +2258,8 @@ _public_ int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, sd_id128_t boot
                 return -EINVAL;
         if (!from && !to)
                 return -EINVAL;
+        if (from == to)
+                return -EINVAL;
 
         HASHMAP_FOREACH(f, j->files, i) {
                 usec_t fr, t;



More information about the systemd-commits mailing list