blob: d27dac82c1013f0beb40cf7f90f74bcb4faf2e28 (
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
26
27
28
29
|
From e659aeb8ee69392cba017fc306cdea20c8c97b70 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 2 Mar 2021 14:24:01 -0800
Subject: [PATCH] libext2fs: avoid pointer arithmetic on `void *`
The pointer operand to the + operator must be to a complete object
type.
Signed-off-by: Michael Forney <mforney@mforney.org>
---
e2fsck/recovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c
index 25744f08..3c5a37e9 100644
--- a/e2fsck/recovery.c
+++ b/e2fsck/recovery.c
@@ -179,7 +179,7 @@ static int jbd2_descriptor_block_csum_verify(journal_t *j, void *buf)
if (!jbd2_journal_has_csum_v2or3(j))
return 1;
- tail = (struct jbd2_journal_block_tail *)(buf + j->j_blocksize -
+ tail = (struct jbd2_journal_block_tail *)((char *)buf + j->j_blocksize -
sizeof(struct jbd2_journal_block_tail));
provided = tail->t_checksum;
tail->t_checksum = 0;
--
2.32.0
|