mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 10:34:40 +03:00
smtp: add data reader fuzzer + fix OOB read
This commit is contained in:
@ -153,3 +153,9 @@ func (r *oneReader) Read(buf []byte) (int, error) {
|
||||
r.buf = r.buf[1:]
|
||||
return 1, nil
|
||||
}
|
||||
|
||||
func FuzzReader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data string) {
|
||||
io.ReadAll(NewDataReader(bufio.NewReader(strings.NewReader(data))))
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user