diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-02-26 13:12:53 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-02-26 13:14:56 +0100 |
commit | 9b7f73b03f99d9375506c7d54e8a993d027e4506 (patch) | |
tree | dcec461fc37f407c4de20949201207573d4c41f8 /src | |
parent | fuzz-lldp: avoid assertion failure on samples which dont fit in pipe (diff) | |
download | systemd-9b7f73b03f99d9375506c7d54e8a993d027e4506.tar.xz systemd-9b7f73b03f99d9375506c7d54e8a993d027e4506.zip |
fuzz-ndisc-rs: avoid assertion failure on samples which dont fit in pipe
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11605.
Diffstat (limited to 'src')
-rw-r--r-- | src/fuzz/fuzz-ndisc-rs.c | 3 | ||||
-rw-r--r-- | src/fuzz/fuzz-ndisc-rs.options | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/fuzz/fuzz-ndisc-rs.c b/src/fuzz/fuzz-ndisc-rs.c index 3a1e60fc5d..d8d256d127 100644 --- a/src/fuzz/fuzz-ndisc-rs.c +++ b/src/fuzz/fuzz-ndisc-rs.c @@ -43,6 +43,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { _cleanup_(sd_event_unrefp) sd_event *e = NULL; _cleanup_(sd_ndisc_unrefp) sd_ndisc *nd = NULL; + if (size > 2048) + return 0; + assert_se(sd_event_new(&e) >= 0); assert_se(sd_ndisc_new(&nd) >= 0); assert_se(sd_ndisc_attach_event(nd, e, 0) >= 0); diff --git a/src/fuzz/fuzz-ndisc-rs.options b/src/fuzz/fuzz-ndisc-rs.options new file mode 100644 index 0000000000..60bd9b0b2f --- /dev/null +++ b/src/fuzz/fuzz-ndisc-rs.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 2048 |