Commit e44b953d authored by Max Kellermann's avatar Max Kellermann

archive/zzip: use zzip_ssize_t to avoid integer overflows

parent 6c850206
...@@ -147,12 +147,12 @@ ZzipInputStream::Read(void *ptr, size_t read_size) ...@@ -147,12 +147,12 @@ ZzipInputStream::Read(void *ptr, size_t read_size)
{ {
const ScopeUnlock unlock(mutex); const ScopeUnlock unlock(mutex);
int ret = zzip_file_read(file, ptr, read_size); zzip_ssize_t nbytes = zzip_file_read(file, ptr, read_size);
if (ret < 0) if (nbytes < 0)
throw std::runtime_error("zzip_file_read() has failed"); throw std::runtime_error("zzip_file_read() has failed");
offset = zzip_tell(file); offset = zzip_tell(file);
return ret; return nbytes;
} }
bool bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment