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
1 changed files with 3 additions and 3 deletions

View File

@ -147,12 +147,12 @@ ZzipInputStream::Read(void *ptr, size_t read_size)
{
const ScopeUnlock unlock(mutex);
int ret = zzip_file_read(file, ptr, read_size);
if (ret < 0)
zzip_ssize_t nbytes = zzip_file_read(file, ptr, read_size);
if (nbytes < 0)
throw std::runtime_error("zzip_file_read() has failed");
offset = zzip_tell(file);
return ret;
return nbytes;
}
bool