Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 3c52238

Browse files
committed
Fix "Issue 38551 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzze"
1 parent c202aa9 commit 3c52238

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

httplib.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,14 @@ inline bool gzip_decompressor::decompress(const char *data, size_t data_length,
29712971
strm_.avail_out = static_cast<uInt>(buff.size());
29722972
strm_.next_out = reinterpret_cast<Bytef *>(buff.data());
29732973

2974+
auto prev_avail_in = strm_.avail_in;
2975+
29742976
ret = inflate(&strm_, Z_NO_FLUSH);
2977+
2978+
if (prev_avail_in - strm_.avail_in == 0) {
2979+
return false;
2980+
}
2981+
29752982
assert(ret != Z_STREAM_ERROR);
29762983
switch (ret) {
29772984
case Z_NEED_DICT:

0 commit comments

Comments
 (0)