[COVERITY] Avoid static buffer overruns in debugfs
Add an extra byte to EXT2_NAME_LEN in the static allocation for the
required trailing null. This allows filenames up to the maximum
length of EXT2_NAME_LEN withover an overrun.
Coverity ID: 11: Overrun Static
Coverity ID: 12: Overrun Static
Coverity ID: 13: Overrun Static
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/debugfs/htree.c b/debugfs/htree.c
index 7abdfc0..2d51ec3 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -35,7 +35,7 @@
struct ext2_dir_entry *dirent;
int thislen, col = 0;
unsigned int offset = 0;
- char name[EXT2_NAME_LEN];
+ char name[EXT2_NAME_LEN + 1];
char tmp[EXT2_NAME_LEN + 16];
blk_t pblk;
ext2_dirhash_t hash;