journal: fix out-of-bounds read CVE-2018-16866
The original code didn't account for the fact that strchr() would match on the '\0' character, making it read past the end of the buffer if no non-whitespace character was present. This bug was introduced in commit ec5ff444 which was first released in systemd v221 and later fixed in commit 8595102d which was released in v240, so versions in the range [v221, v240) are affected.
Loading