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:
parent
680120bb20
commit
e0567bc8ad
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user