mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-12 03:13:52 +08:00
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>
This commit is contained in:
parent
df5487a990
commit
1bc7feaef5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user