Limit url length in FuzzURIParse

We had fuzzers use urls of 500kb which doesn't make sense to test with.
This commit is contained in:
Erik Dubbelboer
2026-01-30 22:55:42 +01:00
parent 5fbda86a8e
commit 3471acf23f
+7
View File
@@ -117,6 +117,13 @@ func FuzzURIParse(f *testing.F) {
f.Add(`http://google.com#@github.com`)
f.Fuzz(func(t *testing.T, uri string) {
// Limit the size of the URI to avoid OOMs or timeouts.
// When using Server or Client the maximum URI is dicated by the maximum header size,
// which defaults to defaultReadBufferSize (4096 bytes).
if len(uri) > defaultReadBufferSize {
return
}
var u URI
uri = strings.ToLower(uri)