Skip to content
Snippets Groups Projects
Unverified Commit 5e2a0b49 authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Igor Munkin
Browse files

test/fuzz: add fuzzing test for xrow_header_decode

The patch adds a fuzzing test for IPROTO decoding function
xrow_header_decode().

NO_DOC=testing
NO_CHANGELOG=testing

(cherry picked from commit ae5964aa)
parent 87d46d0a
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,10 @@ if (NOT ENABLE_UB_SANITIZER)
create_fuzz_test(PREFIX xrow_decode_watch
SOURCES xrow_decode_watch_fuzzer.c
LIBRARIES xrow fuzzer_config)
create_fuzz_test(PREFIX xrow_header_decode
SOURCES xrow_header_decode_fuzzer.c
LIBRARIES xrow fuzzer_config)
endif ()
# Blocked by https://github.com/tarantool/tarantool/issues/8948.
......
#include "box/iproto_constants.h"
#include "box/xrow.h"
#include "memory.h"
void
cord_on_yield(void) {}
__attribute__((constructor))
static void
setup(void)
{
memory_init();
}
__attribute__((destructor))
static void
teardown(void)
{
memory_free();
}
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
const char *p = (const char *)data;
const char *pe = (const char *)data + size;
if (mp_check(&p, pe) != 0)
return -1;
struct xrow_header header;
xrow_header_decode(&header, &p, pe, false);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment