Skip to content

Commit

Permalink
Merge pull request #305 from edisenwangK/fix_gzip_heap_overflow
Browse files Browse the repository at this point in the history
修复可能引起的堆内存泄漏
  • Loading branch information
ruanshudong authored Jun 20, 2024
2 parents 96b0552 + a396ea8 commit 3a78b73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/src/tc_gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool TC_GZip::compress(const char *src, size_t length, string& buffer)
static char gz_simple_header[] = { '\037', '\213', '\010', '\000', '\000', '\000', '\000', '\000', '\002', '\377' };

size_t destLen = sizeof(gz_simple_header) + length * 2;
char *out = new char[destLen + 1];
char *out = new char[destLen + 1 + 8];

stream.next_out = (Bytef *)out;
stream.avail_out = destLen;
Expand Down

0 comments on commit 3a78b73

Please sign in to comment.