mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 17:28:29 +00:00
Fix "Issue 38551 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzze"
This commit is contained in:
parent
c202aa9ce9
commit
3c522386e9
1 changed files with 7 additions and 0 deletions
|
@ -2971,7 +2971,14 @@ inline bool gzip_decompressor::decompress(const char *data, size_t data_length,
|
||||||
strm_.avail_out = static_cast<uInt>(buff.size());
|
strm_.avail_out = static_cast<uInt>(buff.size());
|
||||||
strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
|
strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
|
||||||
|
|
||||||
|
auto prev_avail_in = strm_.avail_in;
|
||||||
|
|
||||||
ret = inflate(&strm_, Z_NO_FLUSH);
|
ret = inflate(&strm_, Z_NO_FLUSH);
|
||||||
|
|
||||||
|
if (prev_avail_in - strm_.avail_in == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
assert(ret != Z_STREAM_ERROR);
|
assert(ret != Z_STREAM_ERROR);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case Z_NEED_DICT:
|
case Z_NEED_DICT:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue