diff options
author | B Stack <bgstack15@gmail.com> | 2019-10-17 15:59:39 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-10-17 15:59:39 -0400 |
commit | 5b604dd360ffc162f163962ccb2b1af109a5f93f (patch) | |
tree | 65292208a81994782e1c16dd84dfcdcc221d0cd7 /zen/zlib_wrap.h | |
parent | Merge branch '10.16' into 'master' (diff) | |
download | FreeFileSync-5b604dd360ffc162f163962ccb2b1af109a5f93f.tar.gz FreeFileSync-5b604dd360ffc162f163962ccb2b1af109a5f93f.tar.bz2 FreeFileSync-5b604dd360ffc162f163962ccb2b1af109a5f93f.zip |
add upstream 10.17
Diffstat (limited to 'zen/zlib_wrap.h')
-rw-r--r-- | zen/zlib_wrap.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zen/zlib_wrap.h b/zen/zlib_wrap.h index fbe26193..9d9229ac 100644 --- a/zen/zlib_wrap.h +++ b/zen/zlib_wrap.h @@ -90,14 +90,14 @@ BinContainer decompress(const BinContainer& stream) //throw SysError //retrieve size of uncompressed data uint64_t uncompressedSize = 0; //use portable number type! if (stream.size() < sizeof(uncompressedSize)) - throw SysError(L"zlib error: stream size < 8"); + throw SysError(L"zlib error: stream size < 8"); std::memcpy(&uncompressedSize, &*stream.begin(), sizeof(uncompressedSize)); //attention: contOut MUST NOT be empty! Else it will pass a nullptr to zlib_decompress() => Z_STREAM_ERROR although "uncompressedSize == 0"!!! //secondary bug: don't dereference iterator into empty container! if (uncompressedSize == 0) //cannot be 0: compress() directly maps empty -> empty container skipping zlib! - throw SysError(L"zlib error: uncompressed size == 0"); + throw SysError(L"zlib error: uncompressed size == 0"); try { @@ -105,7 +105,7 @@ BinContainer decompress(const BinContainer& stream) //throw SysError } catch (const std::bad_alloc& e) //most likely due to data corruption! { - throw SysError(L"zlib error: " + _("Out of memory.") + L" " + utfTo<std::wstring>(e.what())); + throw SysError(L"zlib error: " + _("Out of memory.") + L" " + utfTo<std::wstring>(e.what())); } const size_t bytesWritten = impl::zlib_decompress(&*stream.begin() + sizeof(uncompressedSize), |