mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-08 03:00:26 +01:00
Limit length of bulk string to 4MB. That should really be enough for a Minetest block.
This commit is contained in:
parent
8dba5f5f3b
commit
829f251700
|
@ -92,6 +92,10 @@ func (rp *RedisParser) bulkString(line []byte) bool {
|
|||
case i == 0:
|
||||
return rp.consumer.ConsumeBulkString([]byte{})
|
||||
default:
|
||||
if i >= 4*1024*1024 { // 4MB should be sufficient
|
||||
return rp.consumer.ConsumeError(
|
||||
fmt.Errorf("Bulk string too large (%d bytes).\n", i))
|
||||
}
|
||||
data := make([]byte, i, i)
|
||||
for rest := i; rest > 0; {
|
||||
var n int
|
||||
|
|
Loading…
Reference in New Issue
Block a user