/src/serenity/Meta/Lagom/Fuzzers/FuzzZip.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2021, the SerenityOS developers. |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibArchive/Zip.h> |
8 | | #include <stddef.h> |
9 | | #include <stdint.h> |
10 | | |
11 | | extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) |
12 | 829 | { |
13 | 829 | AK::set_debug_enabled(false); |
14 | 829 | auto zip_file = Archive::Zip::try_create({ data, size }); |
15 | 829 | if (!zip_file.has_value()) |
16 | 432 | return 0; |
17 | | |
18 | 3.17k | (void)zip_file->for_each_member([](auto&) { |
19 | 3.17k | return IterationDecision::Continue; |
20 | 3.17k | }); |
21 | | |
22 | 397 | return 0; |
23 | 829 | } |