diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-01-21 10:49:58 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-02-05 14:45:17 +0100 |
commit | ae59f1666ca62b94355cc6d126e8fcf67f0715ca (patch) | |
tree | 61176ff18c8f03fdc04db4edef2267b3fb6f396e | |
parent | 536ef6d72bc6cd76f3aff02d3bbbd17810216cce (diff) | |
download | systemd-ae59f1666ca62b94355cc6d126e8fcf67f0715ca.tar.gz |
journal: don't use startswith() on something that is not a NUL-terminated string
Otherwise we might access memory coming after it that is not valid or
allocated.
Fixes: #14114
(cherry picked from commit e0567bc8adfe027052b78b40efb57d543924f138)
-rw-r--r-- | src/journal/sd-journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 2b969a6405..055a975b31 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -161,7 +161,7 @@ static int match_is_valid(const void *data, size_t size) { if (size < 2) return false; - if (startswith(data, "__")) + if (((char*) data)[0] == '_' && ((char*) data)[1] == '_') return false; b = data; |