]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: fix printing of xattrs with ea_in_inode values
authorTheodore Ts'o <tytso@mit.edu>
Tue, 26 Mar 2019 13:36:53 +0000 (09:36 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 26 Mar 2019 13:36:53 +0000 (09:36 -0400)
Due to a missing "else" debugfs was printing (garbage) from the xattr
buffer which could potentially overrun the end of the buffer.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/xattrs.c

index 8bbaaeddbf598350d3aadd07cdbfae008f71a68d..bd114503a4c326815b380c580dbb3958c40acff5 100644 (file)
@@ -452,7 +452,7 @@ static void dump_xattr_raw_entries(FILE *f, unsigned char *buf,
                else if (ent.e_value_offs >= len ||
                         (vstart + ent.e_value_size) > len)
                        fprintf(f, "<runs off end>");
-               if (is_mostly_printable((char *)(buf + vstart),
+               else if (is_mostly_printable((char *)(buf + vstart),
                                        ent.e_value_size))
                        safe_print(f, (char *)(buf + vstart),
                                   ent.e_value_size);