From e659aeb8ee69392cba017fc306cdea20c8c97b70 Mon Sep 17 00:00:00 2001 From: Michael Forney 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 --- 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