mirror of
https://github.com/libfuse/libfuse.git
synced 2024-11-23 04:04:31 +08:00
fuse_buf_size fix for SIZE_MAX
This commit is contained in:
parent
535808c4d9
commit
fdafc1d1c6
@ -25,10 +25,10 @@ size_t fuse_buf_size(const struct fuse_bufvec *bufv)
|
||||
size_t size = 0;
|
||||
|
||||
for (i = 0; i < bufv->count; i++) {
|
||||
if (bufv->buf[i].size == SIZE_MAX)
|
||||
size = SIZE_MAX;
|
||||
else
|
||||
size += bufv->buf[i].size;
|
||||
if (bufv->buf[i].size >= SIZE_MAX - size)
|
||||
return SIZE_MAX;
|
||||
|
||||
size += bufv->buf[i].size;
|
||||
}
|
||||
|
||||
return size;
|
||||
|
Loading…
Reference in New Issue
Block a user