Zipper: added an overflow check to make sure to produce a valid zip (next step is to implement zip64)
This commit is contained in:
@@ -39,12 +39,16 @@ namespace Zip
|
||||
{
|
||||
public:
|
||||
|
||||
using SizeZype = std::uint64_t;
|
||||
|
||||
Zipper(const std::map<std::string, std::filesystem::path>& files);
|
||||
|
||||
static constexpr std::size_t minOutputBufferSize = 64;
|
||||
std::size_t writeSome(std::byte* buffer, std::size_t bufferSize);
|
||||
bool isComplete() const;
|
||||
|
||||
SizeZype getTotalZipFile() const { return _totalZipSize; }
|
||||
|
||||
private:
|
||||
void setComplete();
|
||||
|
||||
@@ -79,6 +83,7 @@ namespace Zip
|
||||
Complete,
|
||||
};
|
||||
|
||||
SizeZype _totalZipSize {};
|
||||
WriteState _writeState {WriteState::LocalFileHeader};
|
||||
FileContainer::iterator _currentFile;
|
||||
std::size_t _currentOffset {};
|
||||
|
||||
Reference in New Issue
Block a user