mirror of
https://github.com/aria2/aria2.git
synced 2025-04-07 06:27:37 +03:00
Merge pull request #1970 from himikof/patch-2
Fix undefined behavior/crash in GZipEncoder
This commit is contained in:
commit
8d5989db22
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ std::string GZipEncoder::encode(const unsigned char* in, size_t length,
|
|||
throw DL_ABORT_EX(fmt("libz::deflate() failed. cause:%s", strm_->msg));
|
||||
}
|
||||
size_t produced = outbuf.size() - strm_->avail_out;
|
||||
out.append(&outbuf[0], &outbuf[produced]);
|
||||
out.append(outbuf.data(), outbuf.data() + produced);
|
||||
if (strm_->avail_out > 0) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue