Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
9f49d694
Commit
9f49d694
authored
Aug 22, 2019
by
Miek Gieben
Committed by
corbot[bot]
Aug 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuzz: fix rewrite crash by fixing fuzz/do.go (#3178)
Automatically submitted.
parent
f8e0ae63
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
plugin/pkg/fuzz/do.go
plugin/pkg/fuzz/do.go
+8
-4
No files found.
plugin/pkg/fuzz/do.go
View file @
9f49d694
...
@@ -13,15 +13,19 @@ import (
...
@@ -13,15 +13,19 @@ import (
// Do will fuzz p - used by gofuzz. See Makefile.fuzz for comments and context.
// Do will fuzz p - used by gofuzz. See Makefile.fuzz for comments and context.
func
Do
(
p
plugin
.
Handler
,
data
[]
byte
)
int
{
func
Do
(
p
plugin
.
Handler
,
data
[]
byte
)
int
{
ctx
:=
context
.
TODO
()
ctx
:=
context
.
TODO
()
ret
:=
1
r
:=
new
(
dns
.
Msg
)
r
:=
new
(
dns
.
Msg
)
if
err
:=
r
.
Unpack
(
data
);
err
!=
nil
{
if
err
:=
r
.
Unpack
(
data
);
err
!=
nil
{
ret
=
0
return
0
// plugin will never be called when this happens.
}
// If the data unpack into a dns msg, but does not have a proper question section discard it.
// The server parts make sure this is true before calling the plugins; mimic this behavior.
if
len
(
r
.
Question
)
==
0
{
return
0
}
}
if
_
,
err
:=
p
.
ServeDNS
(
ctx
,
&
test
.
ResponseWriter
{},
r
);
err
!=
nil
{
if
_
,
err
:=
p
.
ServeDNS
(
ctx
,
&
test
.
ResponseWriter
{},
r
);
err
!=
nil
{
ret
=
1
ret
urn
1
}
}
return
ret
return
0
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment