summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-10-09 21:58:54 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-10-09 21:58:54 +0200
commitae3d4e156655aee68a8cb1928c3c742bffd70749 (patch)
treece84c2d25ff4b4ee76576c2dd5f97f0fca6ce405
parentMerge pull request #1 from michael-grosshans/master (diff)
downloadasn1-ber-master.tar
asn1-ber-master.tar.gz
asn1-ber-master.tar.bz2
asn1-ber-master.tar.lz
asn1-ber-master.tar.xz
asn1-ber-master.tar.zst
asn1-ber-master.zip
-rw-r--r--ber.go4
1 files changed, 4 insertions, 0 deletions
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:])