aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/string_utils/base64/fuzz
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/string_utils/base64/fuzz
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/string_utils/base64/fuzz')
-rw-r--r--library/cpp/string_utils/base64/fuzz/generic/ya.make12
-rw-r--r--library/cpp/string_utils/base64/fuzz/lib/main.cpp13
-rw-r--r--library/cpp/string_utils/base64/fuzz/lib/ya.make16
-rw-r--r--library/cpp/string_utils/base64/fuzz/uneven/main.cpp10
-rw-r--r--library/cpp/string_utils/base64/fuzz/uneven/ya.make15
-rw-r--r--library/cpp/string_utils/base64/fuzz/ya.make10
6 files changed, 76 insertions, 0 deletions
diff --git a/library/cpp/string_utils/base64/fuzz/generic/ya.make b/library/cpp/string_utils/base64/fuzz/generic/ya.make
new file mode 100644
index 0000000000..d155e2b0a0
--- /dev/null
+++ b/library/cpp/string_utils/base64/fuzz/generic/ya.make
@@ -0,0 +1,12 @@
+OWNER(
+ yazevnul
+ g:util
+)
+
+FUZZ()
+
+PEERDIR(
+ library/cpp/string_utils/base64/fuzz/lib
+)
+
+END()
diff --git a/library/cpp/string_utils/base64/fuzz/lib/main.cpp b/library/cpp/string_utils/base64/fuzz/lib/main.cpp
new file mode 100644
index 0000000000..28547ae7a5
--- /dev/null
+++ b/library/cpp/string_utils/base64/fuzz/lib/main.cpp
@@ -0,0 +1,13 @@
+#include <library/cpp/string_utils/base64/base64.h>
+
+#include <util/system/types.h>
+#include <util/system/yassert.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const ui8* data, size_t size) {
+ const TStringBuf example{reinterpret_cast<const char*>(data), size};
+ const auto converted = Base64Decode(Base64Encode(example));
+
+ Y_VERIFY(example == converted);
+
+ return 0;
+}
diff --git a/library/cpp/string_utils/base64/fuzz/lib/ya.make b/library/cpp/string_utils/base64/fuzz/lib/ya.make
new file mode 100644
index 0000000000..7b981b86a3
--- /dev/null
+++ b/library/cpp/string_utils/base64/fuzz/lib/ya.make
@@ -0,0 +1,16 @@
+OWNER(
+ yazevnul
+ g:util
+)
+
+LIBRARY()
+
+SRCS(
+ main.cpp
+)
+
+PEERDIR(
+ library/cpp/string_utils/base64
+)
+
+END()
diff --git a/library/cpp/string_utils/base64/fuzz/uneven/main.cpp b/library/cpp/string_utils/base64/fuzz/uneven/main.cpp
new file mode 100644
index 0000000000..915e81a7e5
--- /dev/null
+++ b/library/cpp/string_utils/base64/fuzz/uneven/main.cpp
@@ -0,0 +1,10 @@
+#include <library/cpp/string_utils/base64/base64.h>
+
+#include <util/system/types.h>
+#include <util/system/yassert.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const ui8* data, size_t size) {
+ const TStringBuf example{reinterpret_cast<const char*>(data), size};
+ Y_UNUSED(Base64DecodeUneven(example));
+ return 0;
+}
diff --git a/library/cpp/string_utils/base64/fuzz/uneven/ya.make b/library/cpp/string_utils/base64/fuzz/uneven/ya.make
new file mode 100644
index 0000000000..18cb18ef52
--- /dev/null
+++ b/library/cpp/string_utils/base64/fuzz/uneven/ya.make
@@ -0,0 +1,15 @@
+FUZZ()
+
+OWNER(
+ g:util
+)
+
+SRCS(
+ main.cpp
+)
+
+PEERDIR(
+ library/cpp/string_utils/base64
+)
+
+END()
diff --git a/library/cpp/string_utils/base64/fuzz/ya.make b/library/cpp/string_utils/base64/fuzz/ya.make
new file mode 100644
index 0000000000..bef82061c4
--- /dev/null
+++ b/library/cpp/string_utils/base64/fuzz/ya.make
@@ -0,0 +1,10 @@
+OWNER(
+ yazevnul
+ g:util
+)
+
+RECURSE(
+ generic
+ lib
+ uneven
+)