mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Fuzzers: Add a DNS packet fuzzer
This commit is contained in:
committed by
Andreas Kling
parent
2fbaeb9694
commit
33ad384a7d
18
Meta/Lagom/Fuzzers/FuzzDNSPacket.cpp
Normal file
18
Meta/Lagom/Fuzzers/FuzzDNSPacket.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2023, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibDNS/Packet.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
AK::set_debug_enabled(false);
|
||||
auto maybe_packet = DNS::Packet::from_raw_packet({ data, size });
|
||||
if (!maybe_packet.has_value())
|
||||
return 0;
|
||||
|
||||
(void)maybe_packet.value().to_byte_buffer();
|
||||
return 0;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ set(FUZZER_TARGETS
|
||||
Brotli
|
||||
CyrillicDecoder
|
||||
DDSLoader
|
||||
DNSPacket
|
||||
DeflateCompression
|
||||
DeflateDecompression
|
||||
ELF
|
||||
@@ -80,6 +81,7 @@ set(FUZZER_DEPENDENCIES_Brotli LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_CSSParser LibWeb)
|
||||
set(FUZZER_DEPENDENCIES_CyrillicDecoder LibTextCodec)
|
||||
set(FUZZER_DEPENDENCIES_DDSLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_DNSPacket LibDNS)
|
||||
set(FUZZER_DEPENDENCIES_DeflateCompression LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_DeflateDecompression LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_ELF LibELF)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
T(CSSParser) \
|
||||
T(CyrillicDecoder) \
|
||||
T(DDSLoader) \
|
||||
T(DNSPacket) \
|
||||
T(DeflateCompression) \
|
||||
T(DeflateDecompression) \
|
||||
T(ELF) \
|
||||
|
||||
Reference in New Issue
Block a user