summaryrefslogtreecommitdiff
path: root/src/fuzz
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-25 22:11:44 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-26 10:42:19 +0200
commit483ed8a6a00a00fbd7ef76e304ee265131207ce8 (patch)
tree661a5cd2f7003ec8acf667efe644d193f3b33110 /src/fuzz
parent1238250f1dca07b8fcef4d7ebe86891334819e9e (diff)
downloadsystemd-483ed8a6a00a00fbd7ef76e304ee265131207ce8.tar.gz
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.
Diffstat (limited to 'src/fuzz')
-rw-r--r--src/fuzz/fuzz-unit-file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fuzz/fuzz-unit-file.c b/src/fuzz/fuzz-unit-file.c
index 4865653f5b..a5cd9b4aa9 100644
--- a/src/fuzz/fuzz-unit-file.c
+++ b/src/fuzz/fuzz-unit-file.c
@@ -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);