summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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:])