[SCM] The rsync repository. - branch b3.0.x updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Thu Dec 16 23:25:28 MST 2010


The branch, b3.0.x has been updated
       via  efad2e8 Fix crash when --backup-dir is excessively long.
      from  c463617 Some quoting fixes/improvements.

;a=shortlog;h=b3.0.x


- Log -----------------------------------------------------------------
commit efad2e85ea819c99b601e6e55a4e3d419336033f
Author: Wayne Davison <wayned at samba.org>
Date:   Thu Dec 16 22:15:04 2010 -0800

    Fix crash when --backup-dir is excessively long.

-----------------------------------------------------------------------

Summary of changes:
 options.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/options.c b/options.c
index c01d71c..075c890 100644
--- a/options.c
+++ b/options.c
@@ -1491,17 +1491,18 @@ int parse_arguments(int *argc_p, const char ***argv_p)
 		return 0;
 	}
 	if (backup_dir) {
-		backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
-		backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-		if (backup_dir_remainder < 32) {
+		size_t len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
+		if (len > sizeof backup_dir_buf - 128) {
 			snprintf(err_buf, sizeof err_buf,
 				"the --backup-dir path is WAY too long.\n");
 			return 0;
 		}
+		backup_dir_len = (int)len;
 		if (backup_dir_buf[backup_dir_len - 1] != '/') {
 			backup_dir_buf[backup_dir_len++] = '/';
 			backup_dir_buf[backup_dir_len] = '\0';
 		}
+		backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
 		if (verbose > 1 && !am_sender)
 			rprintf(FINFO, "backup_dir is %s\n", backup_dir_buf);
 	} else if (!backup_suffix_len && (!am_server || !am_sender)) {


-- 
The rsync repository.


More information about the rsync-cvs mailing list