diff options
author | Michael Forney <mforney@mforney.org> | 2020-04-04 21:53:46 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-04-13 21:58:21 -0400 |
commit | 1bc7feaef5685183d5e0301ae9f8d8310487ba12 (patch) | |
tree | 7f08d13e77d21fe8320ed9c57caf54c0c1827fbe | |
parent | df5487a990b81bfdfdc8cb7635dbe83e03931c54 (diff) | |
download | e2fsprogs-1bc7feaef5685183d5e0301ae9f8d8310487ba12.tar.gz |
libext2fs: avoid pointer arithmetic on `void *`
The pointer operand to the binary `+` operator must be to a complete
object type.
Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | lib/ext2fs/csum.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c index a71725807..54b53a3c5 100644 --- a/lib/ext2fs/csum.c +++ b/lib/ext2fs/csum.c @@ -274,7 +274,7 @@ static errcode_t __get_dirent_tail(ext2_filsys fs, rec_len = translate(d->rec_len); } - if ((void *)d > ((void *)dirent + fs->blocksize)) + if ((char *)d > ((char *)dirent + fs->blocksize)) return EXT2_ET_DIR_CORRUPTED; if (d != top) return EXT2_ET_DIR_NO_SPACE_FOR_CSUM; |