From: Theodore Ts'o Date: Tue, 26 Mar 2019 13:36:53 +0000 (-0400) Subject: debugfs: fix printing of xattrs with ea_in_inode values X-Git-Tag: v1.45.1-rc1~29 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=cecc2bc78b39ddcd34a819a4d7e7cd30897958cb;p=tools%2Fe2fsprogs.git debugfs: fix printing of xattrs with ea_in_inode values 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 --- diff --git a/debugfs/xattrs.c b/debugfs/xattrs.c index 8bbaaed..bd11450 100644 --- a/debugfs/xattrs.c +++ b/debugfs/xattrs.c @@ -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, ""); - 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);