Lagom/Fuzzers: Add CSS parser fuzzer
This commit is contained in:
parent
80a074b2e4
commit
be36557198
Notes:
sideshowbarker
2024-07-17 10:34:07 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/be36557198 Pull-request: https://github.com/SerenityOS/serenity/pull/14143
2 changed files with 18 additions and 0 deletions
|
@ -20,6 +20,7 @@ endfunction()
|
|||
|
||||
add_simple_fuzzer(FuzzBMPLoader LagomGfx)
|
||||
add_simple_fuzzer(FuzzBrotli LagomCompress)
|
||||
add_simple_fuzzer(FuzzCSSParser LagomWeb)
|
||||
add_simple_fuzzer(FuzzCyrillicDecoder LagomTextCodec)
|
||||
add_simple_fuzzer(FuzzDeflateCompression LagomCompress)
|
||||
add_simple_fuzzer(FuzzDeflateDecompression LagomCompress)
|
||||
|
|
17
Meta/Lagom/Fuzzers/FuzzCSSParser.cpp
Normal file
17
Meta/Lagom/Fuzzers/FuzzCSSParser.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
Core::EventLoop loop;
|
||||
auto document = Web::DOM::Document::create();
|
||||
(void)Web::parse_css_stylesheet(Web::CSS::Parser::ParsingContext(document), { data, size });
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue