archive/zzip: use zzip_ssize_t to avoid integer overflows

This commit is contained in:
Max Kellermann 2020-09-04 14:13:44 +02:00
parent 6c85020630
commit e44b953d9a

View File

@ -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