diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2007-08-22 16:17:00 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2007-08-22 16:17:00 +0000 |
commit | 62b84f0ed47a1d1fee5e70c53c99a6495f11b074 (patch) | |
tree | e0cbcadd11665aa6ac6ad2a8f4c7bb609ccfcd3b /net/rsync/files | |
parent | fec66f7dc35e01432bd1755ce24df0d128773262 (diff) |
Notes
Diffstat (limited to 'net/rsync/files')
-rw-r--r-- | net/rsync/files/patch-CVE-2007-4091 | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/net/rsync/files/patch-CVE-2007-4091 b/net/rsync/files/patch-CVE-2007-4091 new file mode 100644 index 000000000000..201af96a2390 --- /dev/null +++ b/net/rsync/files/patch-CVE-2007-4091 @@ -0,0 +1,60 @@ +--- sender.c 2006-09-20 03:53:32.000000000 +0200 ++++ sender.c 2007-07-25 15:33:05.000000000 +0200 +@@ -123,6 +123,7 @@ + char fname[MAXPATHLEN]; + struct file_struct *file; + unsigned int offset; ++ size_t l = 0; + + if (ndx < 0 || ndx >= the_file_list->count) + return; +@@ -133,6 +134,20 @@ + file->dir.root, "/", NULL); + } else + offset = 0; ++ ++ l = offset + 1; ++ if (file) { ++ if (file->dirname) ++ l += strlen(file->dirname); ++ if (file->basename) ++ l += strlen(file->basename); ++ } ++ ++ if (l >= sizeof(fname)) { ++ rprintf(FERROR, "Overlong pathname\n"); ++ exit_cleanup(RERR_FILESELECT); ++ } ++ + f_name(file, fname + offset); + if (remove_source_files) { + if (do_unlink(fname) == 0) { +@@ -224,6 +239,7 @@ + enum logcode log_code = log_before_transfer ? FLOG : FINFO; + int f_xfer = write_batch < 0 ? batch_fd : f_out; + int i, j; ++ size_t l = 0; + + if (verbose > 2) + rprintf(FINFO, "send_files starting\n"); +@@ -259,6 +275,20 @@ + fname[offset++] = '/'; + } else + offset = 0; ++ ++ l = offset + 1; ++ if (file) { ++ if (file->dirname) ++ l += strlen(file->dirname); ++ if (file->basename) ++ l += strlen(file->basename); ++ } ++ ++ if (l >= sizeof(fname)) { ++ rprintf(FERROR, "Overlong pathname\n"); ++ exit_cleanup(RERR_FILESELECT); ++ } ++ + fname2 = f_name(file, fname + offset); + + if (verbose > 2) |