summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2012-10-12 20:26:47 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-14 21:53:48 -0400
commit39887731d4a36292674f92effa30e5941419c201 (patch)
treed89cb9f30c703eab5fe8a4830faa61f39b8a04a5
parent53789059e0e9378041697c25af06a08a433fb964 (diff)
sd-journal: check if the pointers passed are the same
-rw-r--r--src/journal/sd-journal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index c21712b7c4..779af62b51 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;