From 4b1553e2d4c6d2df6e7ae327966ccea7b0dc5ca8 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 5 Nov 2007 18:15:01 +0000 Subject: [PATCH] If the xattr data is bogus in get_rsync_acl(), free the buffer. --- acls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acls.c b/acls.c index 6cbd80ab..04cff88a 100644 --- a/acls.c +++ b/acls.c @@ -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); -- 2.11.4.GIT