mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-25 07:08:18 -04:00
If the xattr data is bogus in get_rsync_acl(), free the buffer.
This commit is contained in:
1 parent
e516b69ef6
commit
4b1553e2d4
1 file changed
+3
-1
@@ -476,8 +476,10 @@ static int get_rsync_acl(const char *fname, rsync_acl *racl,
|
||||
if ((buf = get_xattr_acl(fname, type == SMB_ACL_TYPE_ACCESS, &len)) == NULL)
|
||||
return 0;
|
||||
cnt = (len - 4*4) / (4+4);
|
||||
if (len < 4*4 || len != (size_t)cnt*(4+4) + 4*4)
|
||||
if (len < 4*4 || len != (size_t)cnt*(4+4) + 4*4) {
|
||||
free(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
racl->user_obj = IVAL(buf, 0);
|
||||
racl->group_obj = IVAL(buf, 4);
|
||||
|
||||
Reference in new issue
Block a user