fuzzers: ignore size limits when compiled standalone

This way we can still call fuzzers on old samples, but oss-fuzz will not waste
its and our time finding overly large inputs.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-05-12 14:57:07 +02:00
parent 7593691aad
commit c4f883b78e
21 changed files with 37 additions and 19 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
struct in6_addr hint = { { { 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } };
static const char *v1_data = "hogehoge", *v2_data = "foobar";
if (size > 65536)
if (outside_size_range(size, 0, 65536))
return 0;
assert_se(sd_event_new(&e) >= 0);
+1 -1
View File
@@ -23,7 +23,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(sd_event_unrefp) sd_event *e = NULL;
_cleanup_(sd_lldp_rx_unrefp) sd_lldp_rx *lldp_rx = NULL;
if (size > 2048)
if (outside_size_range(size, 0, 2048))
return 0;
assert_se(sd_event_new(&e) == 0);
+1 -1
View File
@@ -43,7 +43,7 @@ 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)
if (outside_size_range(size, 0, 2048))
return 0;
assert_se(sd_event_new(&e) >= 0);