Blame SOURCES/e2fsprogs-1.44.6-debugfs-fix-printing-of-xattrs-with-ea_in_inode-valu.patch

0ab26d
From 563d63dbf762c41f908b5e10deb1b115def93bcc Mon Sep 17 00:00:00 2001
0ab26d
From: Theodore Ts'o <tytso@mit.edu>
0ab26d
Date: Tue, 26 Mar 2019 09:36:53 -0400
0ab26d
Subject: [PATCH 4/4] debugfs: fix printing of xattrs with ea_in_inode values
0ab26d
0ab26d
Due to a missing "else" debugfs was printing (garbage) from the xattr
0ab26d
buffer which could potentially overrun the end of the buffer.
0ab26d
0ab26d
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
0ab26d
---
0ab26d
 debugfs/xattrs.c | 2 +-
0ab26d
 1 file changed, 1 insertion(+), 1 deletion(-)
0ab26d
0ab26d
diff --git a/debugfs/xattrs.c b/debugfs/xattrs.c
0ab26d
index c29761ec..dde9af2f 100644
0ab26d
--- a/debugfs/xattrs.c
0ab26d
+++ b/debugfs/xattrs.c
0ab26d
@@ -448,7 +448,7 @@ static void dump_xattr_raw_entries(FILE *f, unsigned char *buf,
0ab26d
 		else if (ent.e_value_offs >= len ||
0ab26d
 			 (vstart + ent.e_value_size) > len)
0ab26d
 			fprintf(f, "<runs off end>");
0ab26d
-		if (is_mostly_printable((char *)(buf + vstart),
0ab26d
+		else if (is_mostly_printable((char *)(buf + vstart),
0ab26d
 					ent.e_value_size))
0ab26d
 			safe_print(f, (char *)(buf + vstart),
0ab26d
 				   ent.e_value_size);
0ab26d
-- 
0ab26d
2.20.1
0ab26d