blob: ab2000c5f5d23e8b12aa17417a2102f44aece4a9 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/fit/defer.h>
#include <stddef.h>
#include <hid-parser/parser.h>
// fuzz_target.cc
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
hid::DeviceDescriptor* dd = nullptr;
auto result = hid::ParseReportDescriptor(data, size, &dd);
if (result != hid::ParseResult::kParseOk) {
return 0;
}
auto cleanup = fit::defer([dd]() { hid::FreeDeviceDescriptor(dd); });
return 0;
}