diff options
author | nfrmtk <lykov.ivan.02@mail.ru> | 2024-01-21 22:24:53 +0300 |
---|---|---|
committer | lykov-ivan-02 <lykov-ivan-02@yandex.ru> | 2024-03-08 17:49:48 +0300 |
commit | da886006a052a9f9c697878dfe317a37ef413ba7 (patch) | |
tree | 04332ee551fe3cc573253370607a1416a68dc4c6 /core | |
parent | 0bcc0e92b3f0ac57d4c4650722f347593a258572 (diff) | |
download | redot-engine-da886006a052a9f9c697878dfe317a37ef413ba7.tar.gz |
add check for negative buffer_size inside start_(de)compression method.
Diffstat (limited to 'core')
-rw-r--r-- | core/io/stream_peer_gzip.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/io/stream_peer_gzip.cpp b/core/io/stream_peer_gzip.cpp index 4daa71a22a..514bcf59b8 100644 --- a/core/io/stream_peer_gzip.cpp +++ b/core/io/stream_peer_gzip.cpp @@ -76,6 +76,7 @@ Error StreamPeerGZIP::start_decompression(bool p_is_deflate, int buffer_size) { Error StreamPeerGZIP::_start(bool p_compress, bool p_is_deflate, int buffer_size) { ERR_FAIL_COND_V(ctx != nullptr, ERR_ALREADY_IN_USE); + ERR_FAIL_COND_V_MSG(buffer_size <= 0, ERR_INVALID_PARAMETER, "Invalid buffer size. It should be a positive integer."); clear(); compressing = p_compress; rb.resize(nearest_shift(buffer_size - 1)); |