func TestSetStringMalformed(t *testing.T) {
c := &BaseContext
d := new(Decimal)
tests := []string{
".-4",
".-400000000000000000000000000000000000000",
}
for _, test := range tests {
_, _, err := c.SetString(d, test)
if err == nil {
t.Errorf("expected error for SetString(%q)", test)
}
}
}
The panic is in the second test case. Also, I think ".-4" should yield an error (the first test case).
This was found (indirectly) by go-fuzz. Would there be interest in adding a fuzz function or three directly? (I don't have much time to dedicate to this, but I can at least give it a nudge, and/or continue my indirect fuzzing.)
This test panics:
The panic is in the second test case. Also, I think
".-4"
should yield an error (the first test case).This was found (indirectly) by go-fuzz. Would there be interest in adding a fuzz function or three directly? (I don't have much time to dedicate to this, but I can at least give it a nudge, and/or continue my indirect fuzzing.)