Skip to content

Commit bb0a811

Browse files
committed
xattrs: fixed count in qsort
this fixes the count passed to the sort of the xattr list. This issue was reported here: https://www.openwall.com/lists/oss-security/2026/04/16/2 the bug is not exploitable due to the fork-per-connection design of rsync, the attack is the equivalent of the user closing the socket themselves.
1 parent d1df0aa commit bb0a811

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

xattrs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,8 @@ void receive_xattr(int f, struct file_struct *file)
860860
rxa->num = num;
861861
}
862862

863-
if (need_sort && count > 1)
864-
qsort(temp_xattr.items, count, sizeof (rsync_xa), rsync_xal_compare_names);
863+
if (need_sort && temp_xattr.count > 1)
864+
qsort(temp_xattr.items, temp_xattr.count, sizeof (rsync_xa), rsync_xal_compare_names);
865865

866866
ndx = rsync_xal_store(&temp_xattr); /* adds item to rsync_xal_l */
867867

0 commit comments

Comments
 (0)