fuse_send_data_iov(): correctly calculate total buffer size.
authorNikolaus Rath <Nikolaus@rath.org>
Sun, 9 Aug 2020 11:39:07 +0000 (12:39 +0100)
committerNikolaus Rath <Nikolaus@rath.org>
Sun, 9 Aug 2020 11:42:09 +0000 (12:42 +0100)
Fixes: #538.
lib/fuse_lowlevel.c

index 7b72ee0f75f5903f9b1c15595f831c28a48e81de..f4e6138c5bf79ad48ebaf10a6658a25f190b6e28 100644 (file)
@@ -662,7 +662,7 @@ static int fuse_send_data_iov(struct fuse_session *se, struct fuse_chan *ch,
 
        total_buf_size = 0;
        for (idx = buf->idx; idx < buf->count; idx++) {
-               total_buf_size = buf->buf[idx].size;
+               total_buf_size += buf->buf[idx].size;
                if (idx == buf->idx)
                        total_buf_size -= buf->off;
        }