]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
fixed an invalid access to files array master
authorAndrew Tridgell <andrew@tridgell.net>
Sat, 23 Aug 2025 07:26:53 +0000 (17:26 +1000)
committerAndrew Tridgell <andrew@tridgell.net>
Sat, 23 Aug 2025 07:49:19 +0000 (17:49 +1000)
this was found by Calum Hutton from Rapid7. It is a real bug, but
analysis shows it can't be leverged into an exploit. Worth fixing
though.

Many thanks to Calum and Rapid7 for finding and reporting this

sender.c

index a4d46c39e4843df5e0e42dfce845c7e0b8bb855f..b1588b7011720c9cfaa6c8af9bdf54e712f4c0bd 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -262,6 +262,8 @@ void send_files(int f_in, int f_out)
 
                if (ndx - cur_flist->ndx_start >= 0)
                        file = cur_flist->files[ndx - cur_flist->ndx_start];
 
                if (ndx - cur_flist->ndx_start >= 0)
                        file = cur_flist->files[ndx - cur_flist->ndx_start];
+               else if (cur_flist->parent_ndx < 0)
+                       exit_cleanup(RERR_PROTOCOL);
                else
                        file = dir_flist->files[cur_flist->parent_ndx];
                if (F_PATHNAME(file)) {
                else
                        file = dir_flist->files[cur_flist->parent_ndx];
                if (F_PATHNAME(file)) {