[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Fri Apr 22 17:06:55 MDT 2011


The branch, master has been updated
       via  a13d3b3 Avoid adding a slash to path '/'.
       via  813d5a2 Fix a potential crash when trying to find a better block match.
      from  591c224 Improve lsh's handling of -l user option w/cd.

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a13d3b3d77e61d1b31145b6a145325bae065c144
Author: Wayne Davison <wayned at samba.org>
Date:   Fri Apr 22 15:51:55 2011 -0700

    Avoid adding a slash to path '/'.

commit 813d5a25e307bf86169ac6f30b120c02ff116667
Author: Wayne Davison <wayned at samba.org>
Date:   Fri Apr 22 11:31:29 2011 -0700

    Fix a potential crash when trying to find a better block match.

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

Summary of changes:
 match.c |    5 +++--
 util.c  |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/match.c b/match.c
index 9da18a7..f327fd3 100644
--- a/match.c
+++ b/match.c
@@ -239,8 +239,9 @@ static void hash_search(int f,struct sum_struct *s,
 					aligned_offset += s->blength;
 					aligned_i++;
 				}
-				if (offset == aligned_offset
-				 || (sum == 0 && l == s->blength && aligned_offset + l <= len)) {
+				if ((offset == aligned_offset
+				  || (sum == 0 && l == s->blength && aligned_offset + l <= len))
+				 && aligned_i < s->count) {
 					if (i != aligned_i) {
 						if (sum != s->sums[aligned_i].sum1
 						 || l != s->sums[aligned_i].len
diff --git a/util.c b/util.c
index 3f611d1..5200a9a 100644
--- a/util.c
+++ b/util.c
@@ -1062,8 +1062,9 @@ int change_dir(const char *dir, int set_path_only)
 			errno = ENAMETOOLONG;
 			return 0;
 		}
-		curr_dir[curr_dir_len] = '/';
-		memcpy(curr_dir + curr_dir_len + 1, dir, len + 1);
+		if (!(curr_dir_len && curr_dir[curr_dir_len-1] == '/'))
+			curr_dir[curr_dir_len++] = '/';
+		memcpy(curr_dir + curr_dir_len, dir, len + 1);
 
 		if (!set_path_only && chdir(curr_dir)) {
 			curr_dir[curr_dir_len] = '\0';


-- 
The rsync repository.


More information about the rsync-cvs mailing list