summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Fuzzers/FuzzZip.cpp
blob: 9d2d669c0a45a0c2204bc362424203ab3dd8974a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Copyright (c) 2021, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibArchive/Zip.h>
#include <stddef.h>
#include <stdint.h>

extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
    auto zip_file = Archive::Zip::try_create({ data, size });
    if (!zip_file.has_value())
        return 0;

    zip_file->for_each_member([](auto&) {
        return IterationDecision::Continue;
    });

    return 0;
}