Hi, please apply the upstream patch to fix this issue in 1.7-1.
From 932e5fd87e559e07e7264ba9d59b01ec353319b3 Mon Sep 17 00:00:00 2001 From: Daniel Scharrer <dan...@constexpr.org> Date: Sat, 8 Sep 2018 01:52:18 +0200 Subject: [PATCH] slice: Fix support for slices larger than 2 GiB in 32-bit builds
Fixes: issue #68 --- CHANGELOG | 5 +++++ src/stream/slice.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 20d27f0..ea9faac 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,9 @@ +innoextract 1.8 (WIP) + - Added support for installers using an alternative setup loader magic + - Added support for using boost_{zlib,bzip2} when statically linking Boost + - Fixed extracting files from slices larger than 2 GiB with 32-bit builds + innoextract 1.7 (2018-06-12) - Added support for Inno Setup 5.6.0 installers - Added support for new GOG installers with GOG Galaxy file parts diff --git a/src/stream/slice.cpp b/src/stream/slice.cpp index c4b3372..4ed2637 100644 --- a/src/stream/slice.cpp +++ b/src/stream/slice.cpp @@ -231,17 +231,19 @@ std::streamsize slice_reader::read(char * buffer, std::streamsize bytes) { if(read_pos > slice_size) { break; } - std::streamsize remaining = std::streamsize(slice_size - read_pos); + boost::uint32_t remaining = slice_size - read_pos; if(!remaining) { seek(current_slice + 1); read_pos = boost::uint32_t(is->tellg()); if(read_pos > slice_size) { break; } - remaining = std::streamsize(slice_size - read_pos); + remaining = slice_size - read_pos; } - if(is->read(buffer, std::min(remaining, bytes)).fail()) { + boost::uint64_t toread = std::min(boost::uint64_t(remaining), boost::uint64_t(bytes)); + toread = std::min(toread, boost::uint64_t(std::numeric_limits<std::streamsize>::max())); + if(is->read(buffer, std::streamsize(toread)).fail()) { break; }
signature.asc
Description: PGP signature