From cfaae6003b882e75b836be0aa39f3f40b324febf Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Fri, 12 Oct 2012 20:26:47 +0200 Subject: [PATCH] sd-journal: check if the pointers passed are the same --- src/journal/sd-journal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 88b382f..fa90fb8 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -2076,6 +2076,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; @@ -2115,6 +2117,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; -- 1.7.12.1