Skip to content

Commit

Permalink
add check for negative buffer_size inside start_(de)compression method.
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrmtk authored and lykov-ivan-02 committed Mar 8, 2024
1 parent 0bcc0e9 commit da88600
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/io/stream_peer_gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit da88600

Please sign in to comment.