diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/scheme/tests/fuzz_json | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) | |
download | ydb-9123176b341b6f2658cff5132482b8237c1416c8.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/scheme/tests/fuzz_json')
-rw-r--r-- | library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp | 10 | ||||
-rw-r--r-- | library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp | 42 | ||||
-rw-r--r-- | library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h | 14 | ||||
-rw-r--r-- | library/cpp/scheme/tests/fuzz_json/lib/ya.make | 34 | ||||
-rw-r--r-- | library/cpp/scheme/tests/fuzz_json/ya.make | 34 |
5 files changed, 67 insertions, 67 deletions
diff --git a/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp b/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp index 5e93e027c5..8d4c0fa8a0 100644 --- a/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp +++ b/library/cpp/scheme/tests/fuzz_json/fuzz_json.cpp @@ -1,6 +1,6 @@ #include <library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h> - -extern "C" int LLVMFuzzerTestOneInput(const ui8* wireData, const size_t wireSize) { - NSc::NUt::FuzzJson({(const char*)wireData, wireSize}); - return 0; -} + +extern "C" int LLVMFuzzerTestOneInput(const ui8* wireData, const size_t wireSize) { + NSc::NUt::FuzzJson({(const char*)wireData, wireSize}); + return 0; +} diff --git a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp index efaf3d28ef..7c16527c23 100644 --- a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp +++ b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp @@ -1,9 +1,9 @@ -#include "fuzz_json.h" +#include "fuzz_json.h" #include "util/generic/fwd.h" - + #include <library/cpp/scheme/scheme.h> -#include <util/stream/null.h> - +#include <util/stream/null.h> + namespace { static constexpr size_t MAX_DEPTH = 4; static constexpr size_t MAX_PATH_LEN = 256; @@ -75,25 +75,25 @@ namespace { } } -namespace NSc::NUt { +namespace NSc::NUt { - void FuzzJson(TStringBuf wire) { + void FuzzJson(TStringBuf wire) { if (wire.size() < 2) { - return; - } - + return; + } + ProcessPath("[123][1234][12][2134][12312312][1][12]"); - ui8 len1 = wire[0]; - ui8 len2 = wire[1]; - wire.Skip(2); - auto json1 = wire.NextTokAt(len1); - auto json2 = wire.NextTokAt(len2); - NSc::TValue val1 = NSc::TValue::FromJson(json1); - NSc::TValue val2 = NSc::TValue::FromJson(json2); - NSc::TValue val3; - val3.MergeUpdate(val1); + ui8 len1 = wire[0]; + ui8 len2 = wire[1]; + wire.Skip(2); + auto json1 = wire.NextTokAt(len1); + auto json2 = wire.NextTokAt(len2); + NSc::TValue val1 = NSc::TValue::FromJson(json1); + NSc::TValue val2 = NSc::TValue::FromJson(json2); + NSc::TValue val3; + val3.MergeUpdate(val1); size_t i = 0; while (!wire.empty()) { @@ -110,6 +110,6 @@ namespace NSc::NUt { val3 = NSc::TValue(); } } - Cnull << val3.ToJson(); - } -} + Cnull << val3.ToJson(); + } +} diff --git a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h index f61a0c20ef..f8cf7a4770 100644 --- a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h +++ b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.h @@ -1,7 +1,7 @@ -#pragma once - -#include <util/generic/strbuf.h> - -namespace NSc::NUt { - void FuzzJson(TStringBuf wire); -} +#pragma once + +#include <util/generic/strbuf.h> + +namespace NSc::NUt { + void FuzzJson(TStringBuf wire); +} diff --git a/library/cpp/scheme/tests/fuzz_json/lib/ya.make b/library/cpp/scheme/tests/fuzz_json/lib/ya.make index fb49e26b9d..b30a6c9350 100644 --- a/library/cpp/scheme/tests/fuzz_json/lib/ya.make +++ b/library/cpp/scheme/tests/fuzz_json/lib/ya.make @@ -1,18 +1,18 @@ -LIBRARY() - -OWNER( - g:blender - g:middle - g:upper - velavokr -) - -SRCS( - fuzz_json.cpp -) - -PEERDIR( +LIBRARY() + +OWNER( + g:blender + g:middle + g:upper + velavokr +) + +SRCS( + fuzz_json.cpp +) + +PEERDIR( library/cpp/scheme -) - -END() +) + +END() diff --git a/library/cpp/scheme/tests/fuzz_json/ya.make b/library/cpp/scheme/tests/fuzz_json/ya.make index 0b682d1b50..0d91c70585 100644 --- a/library/cpp/scheme/tests/fuzz_json/ya.make +++ b/library/cpp/scheme/tests/fuzz_json/ya.make @@ -1,20 +1,20 @@ -FUZZ() - -OWNER( - g:blender - g:middle - g:upper - velavokr -) - +FUZZ() + +OWNER( + g:blender + g:middle + g:upper + velavokr +) + SIZE(MEDIUM) -SRCS( - fuzz_json.cpp -) - -PEERDIR( +SRCS( + fuzz_json.cpp +) + +PEERDIR( library/cpp/scheme/tests/fuzz_json/lib -) - -END() +) + +END() |