summaryrefslogtreecommitdiffstats
path: root/src/resolve/fuzz-dns-packet.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-12 12:51:11 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-12 14:57:07 +0200
commitc4f883b78e5ffd326a82eaf18e01a9e4e243db58 (patch)
tree712faa735096321206f0afd6097a4dd09bfcd6c1 /src/resolve/fuzz-dns-packet.c
parentfuzzers: add input size limits, always configure limits in two ways (diff)
downloadsystemd-c4f883b78e5ffd326a82eaf18e01a9e4e243db58.tar.xz
systemd-c4f883b78e5ffd326a82eaf18e01a9e4e243db58.zip
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.
Diffstat (limited to 'src/resolve/fuzz-dns-packet.c')
-rw-r--r--src/resolve/fuzz-dns-packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/fuzz-dns-packet.c b/src/resolve/fuzz-dns-packet.c
index b9a0aa1216..de5ee20434 100644
--- a/src/resolve/fuzz-dns-packet.c
+++ b/src/resolve/fuzz-dns-packet.c
@@ -7,7 +7,7 @@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(dns_packet_unrefp) DnsPacket *p = NULL;
- if (size > DNS_PACKET_SIZE_MAX)
+ if (outside_size_range(size, 0, DNS_PACKET_SIZE_MAX))
return 0;
assert_se(dns_packet_new(&p, DNS_PROTOCOL_DNS, 0, DNS_PACKET_SIZE_MAX) >= 0);