Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
b13e9c4e
Unverified
Commit
b13e9c4e
authored
Dec 27, 2020
by
Martin Holst Swende
Committed by
GitHub
Dec 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/fuzzers: fix false positive in bitutil fuzzer (#22076)
parent
9c6b5b90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
compress_fuzz.go
tests/fuzzers/bitutil/compress_fuzz.go
+13
-1
No files found.
tests/fuzzers/bitutil/compress_fuzz.go
View file @
b13e9c4e
...
@@ -51,7 +51,19 @@ func fuzzDecode(data []byte) int {
...
@@ -51,7 +51,19 @@ func fuzzDecode(data []byte) int {
if
err
!=
nil
{
if
err
!=
nil
{
return
0
return
0
}
}
if
comp
:=
bitutil
.
CompressBytes
(
blob
);
!
bytes
.
Equal
(
comp
,
data
)
{
// re-compress it (it's OK if the re-compressed differs from the
// original - the first input may not have been compressed at all)
comp
:=
bitutil
.
CompressBytes
(
blob
)
if
len
(
comp
)
>
len
(
blob
)
{
// After compression, it must be smaller or equal
panic
(
"bad compression"
)
}
// But decompressing it once again should work
decomp
,
err
:=
bitutil
.
DecompressBytes
(
data
,
1024
)
if
err
!=
nil
{
panic
(
err
)
}
if
!
bytes
.
Equal
(
decomp
,
blob
)
{
panic
(
"content mismatch"
)
panic
(
"content mismatch"
)
}
}
return
1
return
1
...
...
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