mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Fuzzers: Add a DNS packet fuzzer
This commit is contained in:
parent
2fbaeb9694
commit
33ad384a7d
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/33ad384a7d Pull-request: https://github.com/SerenityOS/serenity/pull/21753
3 changed files with 21 additions and 0 deletions
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) \
|
||||
|
|
Loading…
Reference in a new issue