commit cbf7749b2fd71caa8504a2bed0225072403f41fe from: Sergey Bronnikov date: Tue Aug 15 14:03:25 2023 UTC test/fuzz: add fuzzing test for decoding decimals NO_DOC=testing NO_CHANGELOG=testing commit - 9706f42d3dbb25dda255cd5092df3a41a8053ace commit + cbf7749b2fd71caa8504a2bed0225072403f41fe blob - 81500c2d555ea82614997983c066c9c8f74b2d67 blob + 86d002ec34b9d9f0e3dda568cb9d7d33bc5bc7ec --- test/fuzz/CMakeLists.txt +++ test/fuzz/CMakeLists.txt @@ -141,6 +141,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. blob - /dev/null blob + de24dbf48e76f6359c611b61dfe243407d5e5112 (mode 644) --- /dev/null +++ test/fuzz/decimal_to_int64_fuzzer.c @@ -0,0 +1,19 @@ +#include +#include +#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; +}