mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-16 16:17:38 +03:00
25 lines
303 B
Go
25 lines
303 B
Go
//go:build gofuzz
|
|
// +build gofuzz
|
|
|
|
package fuzz
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
func Fuzz(data []byte) int {
|
|
u := fasthttp.AcquireURI()
|
|
defer fasthttp.ReleaseURI(u)
|
|
|
|
u.UpdateBytes(data)
|
|
|
|
w := bytes.Buffer{}
|
|
if _, err := u.WriteTo(&w); err != nil {
|
|
return 0
|
|
}
|
|
|
|
return 1
|
|
}
|