Unverified Commit 7202b410 authored by Marius van der Wijden's avatar Marius van der Wijden Committed by GitHub

tests/fuzzers/abi: fixed one-off panic with int.Min64 value (#22233)

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value

* tests/fuzzers/abi: fixed one-off panic with int.Min64 value
parent d2779ed7
...@@ -161,7 +161,10 @@ func getUInt(fuzzer *fuzz.Fuzzer) int { ...@@ -161,7 +161,10 @@ func getUInt(fuzzer *fuzz.Fuzzer) int {
var i int var i int
fuzzer.Fuzz(&i) fuzzer.Fuzz(&i)
if i < 0 { if i < 0 {
i *= -1 i = -i
if i < 0 {
return 0
}
} }
return i return i
} }
...@@ -23,9 +23,7 @@ import ( ...@@ -23,9 +23,7 @@ import (
// TestReplicate can be used to replicate crashers from the fuzzing tests. // TestReplicate can be used to replicate crashers from the fuzzing tests.
// Just replace testString with the data in .quoted // Just replace testString with the data in .quoted
func TestReplicate(t *testing.T) { func TestReplicate(t *testing.T) {
testString := "N\xef\xbf0\xef\xbf99000000000000" + testString := "\x20\x20\x20\x20\x20\x20\x20\x20\x80\x00\x00\x00\x20\x20\x20\x20\x00"
"000000000000"
data := []byte(testString) data := []byte(testString)
runFuzzer(data) runFuzzer(data)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment