mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-24 02:03:54 +03:00
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.
This commit is contained in:
parent
d92e7b8fe4
commit
9b7f73b03f
@ -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);
|
||||
|
2
src/fuzz/fuzz-ndisc-rs.options
Normal file
2
src/fuzz/fuzz-ndisc-rs.options
Normal file
@ -0,0 +1,2 @@
|
||||
[libfuzzer]
|
||||
max_len = 2048
|
Loading…
x
Reference in New Issue
Block a user