summaryrefslogtreecommitdiff
path: root/pkg/sshfs/patch/0010-Avoid-pointer-arithmetic-on-void.patch
blob: 2b29bf26a7560f0ee7886d1cfb7802b7a9c96919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 79f62821ec98aca7cdd25a1bba7a8bdea59272e5 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 2 Jul 2019 19:52:43 -0700
Subject: [PATCH] Avoid pointer arithmetic on `void *`

---
 sshfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sshfs.c b/sshfs.c
index fd7bccb..133b248 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -1182,7 +1182,7 @@ static int do_write(struct iovec *iov, size_t count)
 		do {
 			if ((unsigned) res < iov->iov_len) {
 				iov->iov_len -= res;
-				iov->iov_base += res;
+				iov->iov_base = (char *) iov->iov_base + res;
 				break;
 			} else {
 				res -= iov->iov_len;
-- 
2.24.0