mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
bulk code format fix (#8707)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <clocale>
|
||||
#include <string>
|
||||
|
||||
@@ -19,7 +20,7 @@ static constexpr uint8_t flags_allow_non_utf8 = 0x20;
|
||||
// Utility for test run.
|
||||
OneTimeTestInit OneTimeTestInit::one_time_init_;
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
// Reserve one byte for Parser flags and one byte for repetition counter.
|
||||
if (size < 3) return 0;
|
||||
const uint8_t flags = data[0];
|
||||
@@ -27,7 +28,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
data += 2;
|
||||
size -= 2; // bypass
|
||||
|
||||
const std::string original(reinterpret_cast<const char *>(data), size);
|
||||
const std::string original(reinterpret_cast<const char*>(data), size);
|
||||
auto input = std::string(original.c_str()); // until '\0'
|
||||
if (input.size() < kMinInputLength || input.size() > kMaxInputLength)
|
||||
return 0;
|
||||
@@ -46,7 +47,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
// Check Parser.
|
||||
parser.Parse(parse_input);
|
||||
// TODO:
|
||||
// Need to add additional checks for inputs passed Parse(parse_input) successfully:
|
||||
// Need to add additional checks for inputs passed Parse(parse_input)
|
||||
// successfully:
|
||||
// 1. Serialization to bfbs.
|
||||
// 2. Generation of a default object.
|
||||
// 3. Verification of the object using reflection.
|
||||
|
||||
Reference in New Issue
Block a user