Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
danet
bio-rd
Commits
af52ee3b
Commit
af52ee3b
authored
6 years ago
by
Christoph Petrausch
Browse files
Options
Downloads
Patches
Plain Diff
Updated fuzzing code
parent
55cf3d2a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fuzzing/packet/.gitignore
+2
-0
2 additions, 0 deletions
fuzzing/packet/.gitignore
protocols/bgp/packet/fuzzing.go
+32
-8
32 additions, 8 deletions
protocols/bgp/packet/fuzzing.go
with
34 additions
and
8 deletions
fuzzing/packet/.gitignore
+
2
−
0
View file @
af52ee3b
packet-fuzz.zip
crashers
suppressions
This diff is collapsed.
Click to expand it.
protocols/bgp/packet/fuzzing.go
+
32
−
8
View file @
af52ee3b
// +build gofuzz
// foobar
// +bu ild go fuzz
package
packet
import
"bytes"
import
(
"bytes"
"github.com/bio-routing/bio-rd/protocols/bgp/types"
)
const
(
INC_PRIO
=
1
...
...
@@ -13,13 +18,32 @@ const (
func
Fuzz
(
data
[]
byte
)
int
{
buf
:=
bytes
.
NewBuffer
(
data
)
msg
,
err
:=
Decode
(
buf
)
if
err
!=
nil
{
if
msg
!=
nil
{
panic
(
"msg != nil on error"
)
for
_
,
option
:=
range
getAllOptions
()
{
msg
,
err
:=
Decode
(
buf
,
&
option
)
if
err
!=
nil
{
if
msg
!=
nil
{
panic
(
"msg != nil on error"
)
}
}
return
KEEP
return
INC_PRIO
}
return
KEEP
}
return
INC_PRIO
func
getAllOptions
()
[]
types
.
Options
{
parameters
:=
[]
bool
{
true
,
false
}
var
ret
[]
types
.
Options
for
_
,
octet
:=
range
parameters
{
for
_
,
multi
:=
range
parameters
{
for
_
,
addPathX
:=
range
parameters
{
ret
=
append
(
ret
,
types
.
Options
{
Supports4OctetASN
:
octet
,
SupportsMultiProtocol
:
multi
,
AddPathRX
:
addPathX
,
})
}
}
}
return
ret
}
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