]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: avoid buffer overread when locale name is too long
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 27 Jan 2019 08:37:26 +0000 (09:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 27 Jan 2019 17:34:15 +0000 (18:34 +0100)
commit00e1adf8b1477e8770a49bc2b0ebc2f611f57906
treefc84eed9f43554dfa1b82de40e70f7772237ef80
parentcd8c98d7a75435e5b3eebc927560788acef27f60
journal: avoid buffer overread when locale name is too long

We could potentially create an unterminated string and then call normal string
operations on it. Let's be more careful: first remove the suffix we ignore anyway,
then find if the string is of acceptable length, and possibly ignore it if it
is too long. The code rejects lengths above 31 bytes. Language names that are
actually used are much shorter, so this doesn't matter much.
src/journal/catalog.c