mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-21 00:00:31 +00:00
Limit binary data to 21MB
This commit is contained in:
@@ -14,6 +14,11 @@ func ReadString(r io.Reader, n *int64, err *error) string {
|
||||
if *err != nil {
|
||||
return ""
|
||||
}
|
||||
if MaxBinaryReadSize < *n+int64(length) {
|
||||
*err = ErrMaxBinaryReadSizeReached
|
||||
return ""
|
||||
}
|
||||
|
||||
buf := make([]byte, length)
|
||||
ReadFull(buf, r, n, err)
|
||||
return string(buf)
|
||||
|
||||
Reference in New Issue
Block a user