Skip to content

Commit

Permalink
fix: Limit maximum BER packet length in FuzzParseDN to 65536 bytes (#…
Browse files Browse the repository at this point in the history
…466)

Parallel and large amount of fuzzing data can create large amounts of allocated data and cause restricted fuzzing environments to crash (see #460)
  • Loading branch information
cpuschma authored Sep 15, 2023
1 parent 16bdf0b commit 80095a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

package ldap

import "testing"
import (
ber "github.com/go-asn1-ber/asn1-ber"
"testing"
)

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

f.Add("*")
f.Add("cn=Jim\\0Test")
Expand Down

0 comments on commit 80095a3

Please sign in to comment.