Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
fd0c5d85
Commit
fd0c5d85
authored
3 years ago
by
Alexey Vishnyakov
Committed by
Kirill Yukhin
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
test: Add swim proto fuzz targets.
parent
ee94aa69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/fuzz/CMakeLists.txt
+8
-0
8 additions, 0 deletions
test/fuzz/CMakeLists.txt
test/fuzz/swim_proto_member_fuzzer.c
+44
-0
44 additions, 0 deletions
test/fuzz/swim_proto_member_fuzzer.c
test/fuzz/swim_proto_meta_fuzzer.c
+44
-0
44 additions, 0 deletions
test/fuzz/swim_proto_meta_fuzzer.c
with
96 additions
and
0 deletions
test/fuzz/CMakeLists.txt
+
8
−
0
View file @
fd0c5d85
...
...
@@ -38,8 +38,16 @@ target_link_libraries(uri_fuzzer PUBLIC uri fuzzer_config)
add_executable
(
http_parser_fuzzer http_parser_fuzzer.c
)
target_link_libraries
(
http_parser_fuzzer PUBLIC http_parser fuzzer_config
)
add_executable
(
swim_proto_member_fuzzer swim_proto_member_fuzzer.c
)
target_link_libraries
(
swim_proto_member_fuzzer PUBLIC swim fuzzer_config
)
add_executable
(
swim_proto_meta_fuzzer swim_proto_meta_fuzzer.c
)
target_link_libraries
(
swim_proto_meta_fuzzer PUBLIC swim fuzzer_config
)
set
(
fuzzing_binaries csv_fuzzer
http_parser_fuzzer
swim_proto_member_fuzzer
swim_proto_meta_fuzzer
uri_fuzzer
)
add_custom_target
(
fuzzers
...
...
This diff is collapsed.
Click to expand it.
test/fuzz/swim_proto_member_fuzzer.c
0 → 100644
+
44
−
0
View file @
fd0c5d85
// Copyright 2021 ISP RAS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
#include
<stdint.h>
#include
<stdlib.h>
#include
<stddef.h>
#include
<string.h>
#include
"swim/swim_proto.h"
#include
"fiber.h"
#include
"memory.h"
uint32_t
tarantool_version_id
()
{
return
1
;
}
void
cord_on_yield
()
{}
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
memory_init
();
fiber_init
(
fiber_c_invoke
);
struct
swim_member_def
def
;
const
char
*
pos
=
(
const
char
*
)
data
;
swim_member_def_decode
(
&
def
,
&
pos
,
pos
+
size
,
""
);
fiber_free
();
memory_free
();
return
0
;
}
This diff is collapsed.
Click to expand it.
test/fuzz/swim_proto_meta_fuzzer.c
0 → 100644
+
44
−
0
View file @
fd0c5d85
// Copyright 2021 ISP RAS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
#include
<stdint.h>
#include
<stdlib.h>
#include
<stddef.h>
#include
<string.h>
#include
"swim/swim_proto.h"
#include
"fiber.h"
#include
"memory.h"
uint32_t
tarantool_version_id
()
{
return
1
;
}
void
cord_on_yield
()
{}
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
memory_init
();
fiber_init
(
fiber_c_invoke
);
struct
swim_meta_def
def
;
const
char
*
pos
=
(
const
char
*
)
data
;
swim_meta_def_decode
(
&
def
,
&
pos
,
pos
+
size
);
fiber_free
();
memory_free
();
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment