diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-10-09 21:58:54 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-10-09 21:58:54 +0200 |
commit | ae3d4e156655aee68a8cb1928c3c742bffd70749 (patch) | |
tree | ce84c2d25ff4b4ee76576c2dd5f97f0fca6ce405 /ber.go | |
parent | Merge pull request #1 from michael-grosshans/master (diff) | |
download | asn1-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 |
Diffstat (limited to 'ber.go')
-rw-r--r-- | ber.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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:]) |