MOS Source Code
|
#include <pb_decode.h>
#include <pb_encode.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <malloc_wrappers.h>
#include "random_data.h"
#include "validation.h"
#include "flakystream.h"
#include "test_helpers.h"
#include "alltypes_static.pb.h"
#include "alltypes_pointer.pb.h"
#include "alltypes_callback.pb.h"
#include "alltypes_proto3_static.pb.h"
#include "alltypes_proto3_pointer.pb.h"
Go to the source code of this file.
Macros | |
#define | FUZZTEST_BUFSIZE 256*1024 |
#define | FUZZTEST_MAX_STANDALONE_BUFSIZE 16384 |
#define | FUZZTEST_PROTO2_STATIC |
#define | FUZZTEST_PROTO3_STATIC |
#define | FUZZTEST_PROTO2_POINTER |
#define | FUZZTEST_PROTO3_POINTER |
#define | FUZZTEST_IO_ERRORS |
Functions | |
static uint32_t | xor32_checksum (const void *data, size_t len) |
static bool | do_decode (const uint8_t *buffer, size_t msglen, size_t structsize, const pb_msgdesc_t *msgtype, unsigned flags, bool assert_success) |
static bool | do_stream_decode (const uint8_t *buffer, size_t msglen, size_t fail_after, size_t structsize, const pb_msgdesc_t *msgtype, bool assert_success) |
static bool | field_callback (pb_istream_t *stream, const pb_field_t *field, void **arg) |
static bool | submsg_callback (pb_istream_t *stream, const pb_field_t *field, void **arg) |
bool | do_callback_decode (const uint8_t *buffer, size_t msglen, bool assert_success) |
void | do_roundtrip (const uint8_t *buffer, size_t msglen, size_t structsize, const pb_msgdesc_t *msgtype) |
void | do_roundtrips (const uint8_t *data, size_t size, bool expect_valid) |
int | LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) |
static bool | generate_base_message (uint8_t *buffer, size_t *msglen) |
static void | run_iteration () |
int | main (int argc, char **argv) |
Variables | |
static size_t | g_bufsize = 256*1024 |
static int | g_sentinel |
#define FUZZTEST_BUFSIZE 256*1024 |
Definition at line 29 of file fuzztest.c.
#define FUZZTEST_MAX_STANDALONE_BUFSIZE 16384 |
Definition at line 32 of file fuzztest.c.
Referenced by main().
#define FUZZTEST_PROTO2_STATIC |
Definition at line 44 of file fuzztest.c.
#define FUZZTEST_PROTO3_STATIC |
Definition at line 45 of file fuzztest.c.
#define FUZZTEST_PROTO2_POINTER |
Definition at line 46 of file fuzztest.c.
#define FUZZTEST_PROTO3_POINTER |
Definition at line 47 of file fuzztest.c.
#define FUZZTEST_IO_ERRORS |
Definition at line 48 of file fuzztest.c.
Definition at line 51 of file fuzztest.c.
Referenced by do_roundtrip().
|
static |
Definition at line 112 of file fuzztest.c.
Referenced by do_roundtrips().
|
static |
Definition at line 144 of file fuzztest.c.
Referenced by do_callback_decode().
|
static |
Definition at line 152 of file fuzztest.c.
Referenced by do_callback_decode().
Definition at line 160 of file fuzztest.c.
Referenced by do_roundtrips().
void do_roundtrip | ( | const uint8_t * | buffer, |
size_t | msglen, | ||
size_t | structsize, | ||
const pb_msgdesc_t * | msgtype ) |
Definition at line 198 of file fuzztest.c.
Referenced by do_roundtrips().
Definition at line 289 of file fuzztest.c.
Referenced by LLVMFuzzerTestOneInput(), and run_iteration().
Definition at line 352 of file fuzztest.c.
Referenced by main().
Definition at line 364 of file fuzztest.c.
Referenced by run_iteration().
|
static |
Definition at line 393 of file fuzztest.c.
Referenced by main().
|
static |
Definition at line 34 of file fuzztest.c.
Referenced by do_decode(), do_roundtrip(), generate_base_message(), LLVMFuzzerTestOneInput(), main(), and run_iteration().
|
static |
Definition at line 142 of file fuzztest.c.
Referenced by do_callback_decode(), field_callback(), and submsg_callback().