archive/zzip: use zzip_ssize_t to avoid integer overflows
This commit is contained in:
parent
6c85020630
commit
e44b953d9a
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user