mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-15 16:07:51 +03:00
27 lines
346 B
Go
27 lines
346 B
Go
//go:build gofuzz
|
|
// +build gofuzz
|
|
|
|
package fuzz
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
func Fuzz(data []byte) int {
|
|
c := fasthttp.AcquireCookie()
|
|
defer fasthttp.ReleaseCookie(c)
|
|
|
|
if err := c.ParseBytes(data); err != nil {
|
|
return 0
|
|
}
|
|
|
|
w := bytes.Buffer{}
|
|
if _, err := c.WriteTo(&w); err != nil {
|
|
return 0
|
|
}
|
|
|
|
return 1
|
|
}
|