Skip to content

Commit 80095a3

Browse files
authored
fix: Limit maximum BER packet length in FuzzParseDN to 65536 bytes (#466)
Parallel and large amount of fuzzing data can create large amounts of allocated data and cause restricted fuzzing environments to crash (see #460)
1 parent 16bdf0b commit 80095a3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

fuzz_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33

44
package ldap
55

6-
import "testing"
6+
import (
7+
ber "github.com/go-asn1-ber/asn1-ber"
8+
"testing"
9+
)
710

811
func FuzzParseDN(f *testing.F) {
12+
// See https://github.com/go-asn1-ber/asn1-ber/blob/04301b4b1c5ff66221f8f8a394f814a9917d678a/fuzz_test.go#L33-L37
13+
// for why this limitation is necessary
14+
ber.MaxPacketLengthBytes = 65536
915

1016
f.Add("*")
1117
f.Add("cn=Jim\\0Test")

0 commit comments

Comments
 (0)