summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp
blob: a5d31df0fa3471a7c09e25c5d73932b3cfb7279f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * Copyright (c) 2021, Kyle Pereira <hey@xylepereira.me>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibIMAP/Parser.h>
#include <stddef.h>
#include <stdint.h>

extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
    auto parser = IMAP::Parser();
    parser.parse(ByteBuffer::copy(data, size).release_value(), true);
    parser.parse(ByteBuffer::copy(data, size).release_value(), false);
    return 0;
}