Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > d065580f3b0c4a3d2606e9cadfcf00fe > files > 2

rsync-3.1.1-5.4.mga5.src.rpm

From: Wayne Davison <wayned@samba.org>
Date: Sun, 5 Nov 2017 11:33:15 -0800
Subject: Enforce trailing \0 when receiving xattr name values. Fixes bug
 13112.
Origin: https://git.samba.org/rsync.git/?p=rsync.git;a=commit;h=47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13112
Bug-Debian: https://bugs.debian.org/880954
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-16548

---
 xattrs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xattrs.c b/xattrs.c
index 68305d75..4867e6f5 100644
--- a/xattrs.c
+++ b/xattrs.c
@@ -824,6 +824,10 @@ void receive_xattr(int f, struct file_struct *file)
 			out_of_memory("receive_xattr");
 		name = ptr + dget_len + extra_len;
 		read_buf(f, name, name_len);
+		if (name_len < 1 || name[name_len-1] != '\0') {
+			rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n");
+			exit_cleanup(RERR_FILEIO);
+		}
 		if (dget_len == datum_len)
 			read_buf(f, ptr, dget_len);
 		else {
-- 
2.15.1