diff -Nuarp rsync-3.4.1.orig/xattrs.c rsync-3.4.1/xattrs.c
--- rsync-3.4.1.orig/xattrs.c	2022-09-14 01:43:01.000000000 -0400
+++ rsync-3.4.1/xattrs.c	2026-04-16 15:28:13.403481269 -0400
@@ -860,8 +860,8 @@ void receive_xattr(int f, struct file_st
 		rxa->num = num;
 	}
 
-	if (need_sort && count > 1)
-		qsort(temp_xattr.items, count, sizeof (rsync_xa), rsync_xal_compare_names);
+	if (need_sort && temp_xattr.count > 1)
+		qsort(temp_xattr.items, temp_xattr.count, sizeof (rsync_xa), rsync_xal_compare_names);
 
 	ndx = rsync_xal_store(&temp_xattr); /* adds item to rsync_xal_l */
 
