summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-30 22:46:07 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-30 22:46:07 +0200
commitd94117a93c0a8431de5c765f21a97f6eb32580da (patch)
treeea620eb41b5410ecbf4beb8ea224f1f17f02697d /src/journal
parente51240886f54e0128b1711c7dd0454b23e3f7d5e (diff)
journal: don't allow adding invalid matches to the context
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/sd-journal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 09ce949d3b..9f46f5c6aa 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -115,7 +115,11 @@ _public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size)
return -EINVAL;
if (!data)
return -EINVAL;
- if (size <= 0)
+ if (size <= 1)
+ return -EINVAL;
+ if (!memchr(data, '=', size))
+ return -EINVAL;
+ if (*(char*) data == '=')
return -EINVAL;
/* FIXME: iterating with multiple matches is currently