File: flexbuffers_verifier_fuzzer.cc

package info (click to toggle)
flatbuffers 2.0.8%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,308 kB
  • sloc: cpp: 44,808; python: 6,544; cs: 4,852; java: 4,389; ansic: 1,615; php: 1,455; xml: 973; javascript: 938; sh: 806; makefile: 35
file content (19 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2015 The Chromium 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 <stddef.h>
#include <stdint.h>
#include <string>

#include "flatbuffers/flexbuffers.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  std::vector<uint8_t> reuse_tracker;
  // Check both with and without reuse tracker paths.
  flexbuffers::VerifyBuffer(data, size, &reuse_tracker);
  // FIXME: we can't really verify this path, because the fuzzer will
  // construct buffers that time out.
  // Add a simple #define to bound the number of steps just for the fuzzer?
  //flexbuffers::VerifyBuffer(data, size, nullptr);
  return 0;
}