]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Use the right sum len.
authorWayne Davison <wayned@samba.org>
Tue, 7 Nov 2017 21:32:10 +0000 (13:32 -0800)
committerWayne Davison <wayned@samba.org>
Tue, 7 Nov 2017 21:32:10 +0000 (13:32 -0800)
xattrs.c

index 4867e6f5b8ad2934d43b06f3b99b7b3690a6dc7a..9d4e3d62fd505c67d3c130ae5a080bc1f24ec663 100644 (file)
--- a/xattrs.c
+++ b/xattrs.c
@@ -979,6 +979,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
                name = rxas[i].name;
 
                if (XATTR_ABBREV(rxas[i])) {
+                       int sum_len;
                        /* See if the fnamecmp version is identical. */
                        len = name_len = rxas[i].name_len;
                        if ((ptr = get_xattr_data(fnamecmp, name, &len, 1)) == NULL) {
@@ -997,8 +998,8 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
 
                        sum_init(-1, checksum_seed);
                        sum_update(ptr, len);
-                       sum_end(sum);
-                       if (memcmp(sum, rxas[i].datum + 1, MAX_DIGEST_LEN) != 0) {
+                       sum_len = sum_end(sum);
+                       if (memcmp(sum, rxas[i].datum + 1, sum_len) != 0) {
                                free(ptr);
                                goto still_abbrev;
                        }