chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e512408
)
journal: don't allow adding invalid matches to the context
author
Lennart Poettering
<lennart@poettering.net>
Wed, 30 May 2012 20:46:07 +0000
(22:46 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 30 May 2012 20:46:07 +0000
(22:46 +0200)
src/journal/sd-journal.c
patch
|
blob
|
history
diff --git
a/src/journal/sd-journal.c
b/src/journal/sd-journal.c
index 09ce949d3bd21a1f5e6d9be65f69e2af504f8274..9f46f5c6aa4d85e3fa3f02ec2e7cc6a0b28455cb 100644
(file)
--- 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