fuzz-unit-file: adjust check for ListenNetlink yet again

The test for ListenNetlink would abort the loop if a line longer then LINE_MAX
was encountered (read_line() returns -ENOBUFS in that case). Let's use the
the line length limit that the unit file parses uses.

https://oss-fuzz.com/v2/issue/5546208027213824/7094.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-25 22:11:44 +02:00
parent 1238250f1d
commit 483ed8a6a0
1 changed files with 4 additions and 2 deletions

View File

@ -43,15 +43,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_free_ char *l = NULL;
const char *ll;
if (read_line(f, LINE_MAX, &l) <= 0)
if (read_line(f, LONG_LINE_MAX, &l) <= 0)
break;
ll = l + strspn(l, WHITESPACE);
if (startswith(ll, "ListenNetlink="))
if (startswith(ll, "ListenNetlink=")) {
/* ListenNetlink causes a false positive in msan,
* let's skip this for now. */
log_notice("Skipping test because ListenNetlink= is present");
return 0;
}
}
assert_se(fseek(f, offset, SEEK_SET) == 0);