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/lib/fuzz_json.cpp | |
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/lib/fuzz_json.cpp')
-rw-r--r-- | library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
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(); + } +} |