Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 381cebfe authored by Dan Carpenter's avatar Dan Carpenter Committed by Theodore Ts'o
Browse files

ext4: silence array overflow warning



I get a static checker warning:

    fs/ext4/ext4.h:3091 ext4_set_de_type()
    error: buffer overflow 'ext4_type_by_mode' 15 <= 15

It seems unlikely that we would hit this read overflow in real life, but
it's also simple enough to make the array 16 bytes instead of 15.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent fcf5ea10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3072,7 +3072,7 @@ extern int ext4_handle_dirty_dirent_node(handle_t *handle,
					 struct inode *inode,
					 struct buffer_head *bh);
#define S_SHIFT 12
static const unsigned char ext4_type_by_mode[S_IFMT >> S_SHIFT] = {
static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = {
	[S_IFREG >> S_SHIFT]	= EXT4_FT_REG_FILE,
	[S_IFDIR >> S_SHIFT]	= EXT4_FT_DIR,
	[S_IFCHR >> S_SHIFT]	= EXT4_FT_CHRDEV,