nats-io / nats-streaming-server

NATS Streaming System Server
https://nats.io
Apache License 2.0
2.51k stars 283 forks source link

[ADDED] FileStore: RecordSizeLimit to limit single record read size #1259

Closed kozlovic closed 2 years ago

kozlovic commented 2 years ago

In case of memory corruption, it is possible that the record size is way greater than it should, which would cause the server to create a buffer of the wrong size in the attempt to read the record. This new option will limit how big the buffer needed to read the record from disk can be.

Resolves #1255

Signed-off-by: Ivan Kozlovic ivan@synadia.com

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.03%) to 91.535% when pulling f7c403b683a896d7408fb7fc271672b200a282c6 on fix_1255 into 3520b47d81e65a0b7e044835f85932569150112d on main.