fuzz-lldp: avoid assertion failure on samples which dont fit in pipe

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11603.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-02-26 13:12:53 +01:00
parent eafadd069c
commit d92e7b8fe4
2 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(sd_event_unrefp) sd_event *e = NULL;
_cleanup_(sd_lldp_unrefp) sd_lldp *lldp = NULL;
if (size > 2048)
return 0;
assert_se(sd_event_new(&e) == 0);
assert_se(sd_lldp_new(&lldp) >= 0);
assert_se(sd_lldp_set_ifindex(lldp, 42) >= 0);

View File

@ -0,0 +1,2 @@
[libfuzzer]
max_len = 2048