diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/generic/fuzz | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/fuzz')
-rw-r--r-- | util/generic/fuzz/vector/main.cpp | 90 | ||||
-rw-r--r-- | util/generic/fuzz/vector/ya.make | 14 | ||||
-rw-r--r-- | util/generic/fuzz/ya.make | 6 |
3 files changed, 55 insertions, 55 deletions
diff --git a/util/generic/fuzz/vector/main.cpp b/util/generic/fuzz/vector/main.cpp index 0a0293f795..9d3211da96 100644 --- a/util/generic/fuzz/vector/main.cpp +++ b/util/generic/fuzz/vector/main.cpp @@ -1,47 +1,47 @@ -#include <util/generic/vector.h> -#include <util/stream/mem.h> - -template <class T> +#include <util/generic/vector.h> +#include <util/stream/mem.h> + +template <class T> static inline T Read(IInputStream& in) { - T t; - - in.LoadOrFail(&t, sizeof(t)); - - return t; -} - -extern "C" int LLVMFuzzerTestOneInput(const ui8* data, size_t size) { - TMemoryInput mi(data, size); - - try { + T t; + + in.LoadOrFail(&t, sizeof(t)); + + return t; +} + +extern "C" int LLVMFuzzerTestOneInput(const ui8* data, size_t size) { + TMemoryInput mi(data, size); + + try { TVector<ui16> v; - - while (mi.Avail()) { - char cmd = Read<char>(mi); - - switch (cmd % 2) { - case 0: { - const size_t cnt = 1 + Read<ui8>(mi) % 16; - - for (size_t i = 0; i < cnt; ++i) { - v.push_back(i); - } - - break; - } - - case 1: { - if (v) { - v.pop_back(); - } - - break; - } - } - } - } catch (...) { - // ¯\_(ツ)_/¯ - } - - return 0; // Non-zero return values are reserved for future use. -} + + while (mi.Avail()) { + char cmd = Read<char>(mi); + + switch (cmd % 2) { + case 0: { + const size_t cnt = 1 + Read<ui8>(mi) % 16; + + for (size_t i = 0; i < cnt; ++i) { + v.push_back(i); + } + + break; + } + + case 1: { + if (v) { + v.pop_back(); + } + + break; + } + } + } + } catch (...) { + // ¯\_(ツ)_/¯ + } + + return 0; // Non-zero return values are reserved for future use. +} diff --git a/util/generic/fuzz/vector/ya.make b/util/generic/fuzz/vector/ya.make index b8614f6411..14986170eb 100644 --- a/util/generic/fuzz/vector/ya.make +++ b/util/generic/fuzz/vector/ya.make @@ -1,13 +1,13 @@ FUZZ() - + OWNER( pg g:util ) SUBSCRIBER(g:util-subscribers) - -SRCS( - main.cpp -) - -END() + +SRCS( + main.cpp +) + +END() diff --git a/util/generic/fuzz/ya.make b/util/generic/fuzz/ya.make index dc60b12a0c..947437e0eb 100644 --- a/util/generic/fuzz/ya.make +++ b/util/generic/fuzz/ya.make @@ -1,3 +1,3 @@ -RECURSE( - vector -) +RECURSE( + vector +) |