From acfa3938ba87cea85c67b8008176d83de7317e90 Mon Sep 17 00:00:00 2001 From: Chad Fraleigh Date: Tue, 15 Aug 2023 19:16:38 -0700 Subject: [PATCH] Added ToBase64Standard fuzzer. --- fuzzing/CMakeLists.txt | 1 + fuzzing/fuzz-ToBase64Standard.cc | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 fuzzing/fuzz-ToBase64Standard.cc diff --git a/fuzzing/CMakeLists.txt b/fuzzing/CMakeLists.txt index b18b4e9a..5f079d3b 100644 --- a/fuzzing/CMakeLists.txt +++ b/fuzzing/CMakeLists.txt @@ -42,6 +42,7 @@ set(FUZZERS RouterContext-DecryptTunnelBuildRecord RouterContext-ProcessDeliveryStatusMessage RouterContext-ProcessGarlicMessage + ToBase64Standard ) string(REPLACE "fuzzer-no-link" "fuzzer" _LINK_FLAGS "${_SANITIZE_FLAGS}") diff --git a/fuzzing/fuzz-ToBase64Standard.cc b/fuzzing/fuzz-ToBase64Standard.cc new file mode 100644 index 00000000..2707d74d --- /dev/null +++ b/fuzzing/fuzz-ToBase64Standard.cc @@ -0,0 +1,21 @@ + + +#include +#include +#include + +#include + +#include "fuzzing.h" + + +bool +fuzzing_testinput(const uint8_t * data, size_t size) +{ + std::string str((const char *) data, size); + + + i2p::data::ToBase64Standard(str); + + return true; +}