diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-01-21 10:49:58 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-01-21 14:32:15 +0100 |
commit | e0567bc8adfe027052b78b40efb57d543924f138 (patch) | |
tree | 6e199a00b50c1444d54dcb2811ad7477878a0dce /src/journal/sd-journal.c | |
parent | virt: do not define vm_from_string() for non-x86 architecture (diff) | |
download | systemd-e0567bc8adfe027052b78b40efb57d543924f138.tar.xz systemd-e0567bc8adfe027052b78b40efb57d543924f138.zip |
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
Diffstat (limited to '')
-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 358f2fd738..837aecdf60 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; |