diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt index 6ad7a203be7abc858a80ddf13de7df808938c234..f79f2f2907c17e1147ef8bec7e9be5440aadb538 100644 --- a/test/fuzz/CMakeLists.txt +++ b/test/fuzz/CMakeLists.txt @@ -133,6 +133,13 @@ if (NOT ENABLE_UB_SANITIZER) LIBRARIES xrow fuzzer_config) endif () +# Blocked by https://github.com/tarantool/tarantool/issues/8948. +if (NOT ENABLE_UB_SANITIZER) + create_fuzz_test(PREFIX decimal_to_int64 + SOURCES decimal_to_int64_fuzzer.c + LIBRARIES core fuzzer_config) +endif () + include(ProtobufMutator) # UndefinedBehaviorSanitizer is not supported in LuaJIT. diff --git a/test/fuzz/decimal_to_int64_fuzzer.c b/test/fuzz/decimal_to_int64_fuzzer.c new file mode 100644 index 0000000000000000000000000000000000000000..de24dbf48e76f6359c611b61dfe243407d5e5112 --- /dev/null +++ b/test/fuzz/decimal_to_int64_fuzzer.c @@ -0,0 +1,19 @@ +#include <string.h> +#include <stdlib.h> +#include "decimal.h" +#include "trivia/util.h" + +int +LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + char *buf = xcalloc(size + 1, sizeof(char)); + if (!buf) + return 0; + memcpy(buf, data, size); + buf[size] = '\0'; + decimal_t d; + decimal_from_string(&d, buf); + free(buf); + + return 0; +}