From ae3d4e156655aee68a8cb1928c3c742bffd70749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Wed, 9 Oct 2024 21:58:54 +0200 Subject: fix DoS in TLV --- ber.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ber.go b/ber.go index 95755fe..250f3c5 100644 --- a/ber.go +++ b/ber.go @@ -235,6 +235,10 @@ func ReadPacket(reader io.Reader) (*Packet, error) { } } + if datalen > 1024*1024*16 { + return nil, err + } + buf = resizeBuffer(buf, idx+datalen) err = readBytes(reader, buf[idx:]) -- cgit v1.2.3