1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-15 05:57:26 +03:00

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
This commit is contained in:
Lennart Poettering 2020-01-21 10:49:58 +01:00
parent 680120bb20
commit e0567bc8ad

View File

@ -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;