chiark / gitweb /
sd-journal: check if the pointers passed are the same
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 12 Oct 2012 18:26:47 +0000 (20:26 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 15 May 2013 01:53:48 +0000 (21:53 -0400)
src/journal/sd-journal.c

index c21712b..779af62 100644 (file)
@@ -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;