mirror of
https://github.com/systemd/systemd
synced 2024-10-14 20:17:52 +00:00
journal-importer: ignore invalid field at one more place
Fixes oss-fuzz#28817. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28817
This commit is contained in:
parent
3d909037e3
commit
8786d4bbe4
|
@ -334,6 +334,16 @@ int journal_importer_process_data(JournalImporter *imp) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
} else {
|
||||
if (!journal_field_valid(line, n - 1, true)) {
|
||||
char buf[64], *t;
|
||||
|
||||
t = strndupa(line, n - 1);
|
||||
log_debug("Ignoring invalid field: \"%s\"",
|
||||
cellescape(buf, sizeof buf, t));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* replace \n with = */
|
||||
line[n-1] = '=';
|
||||
|
||||
|
|
BIN
test/fuzz/fuzz-journal-remote/oss-fuzz-28817
Normal file
BIN
test/fuzz/fuzz-journal-remote/oss-fuzz-28817
Normal file
Binary file not shown.
Loading…
Reference in a new issue