1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
X-Git-Url: http://git.samba.org/?p=rsync.git;a=blobdiff_plain;f=lib%2Fsysacls.c;fp=lib%2Fsysacls.c;h=7334fd405ae4e2bd2fb244dd4fc0845a662b24c4;hp=071b06f852b87746dc3fc1ce27a199c022926f26;hb=aacd188034703acc9d4ab43704d627f5d48a7eb8;hpb=bb640d32213c5dce2ad26515b5fc26e023ec9b98
diff --git a/lib/sysacls.c b/lib/sysacls.c
index 071b06f..7334fd4 100644
--- a/lib/sysacls.c
+++ b/lib/sysacls.c
@@ -551,7 +551,7 @@ SMB_ACL_T sys_acl_init(int count)
* acl[] array, this actually allocates an ACL with room
* for (count+1) entries
*/
- if ((a = (SMB_ACL_T)SMB_MALLOC(sizeof(struct SMB_ACL_T) + count * sizeof(struct acl))) == NULL) {
+ if ((a = (SMB_ACL_T)SMB_MALLOC(sizeof a[0] + count * sizeof (struct acl))) == NULL) {
errno = ENOMEM;
return NULL;
}
@@ -1007,7 +1007,7 @@ SMB_ACL_T sys_acl_init(int count)
* acl[] array, this actually allocates an ACL with room
* for (count+1) entries
*/
- if ((a = SMB_MALLOC(sizeof(struct SMB_ACL_T) + count * sizeof(struct acl))) == NULL) {
+ if ((a = (SMB_ACL_T)SMB_MALLOC(sizeof a[0] + count * sizeof(struct acl))) == NULL) {
errno = ENOMEM;
return NULL;
}
@@ -1638,14 +1638,14 @@ SMB_ACL_T sys_acl_init(int count)
return NULL;
}
- if ((a = SMB_MALLOC(sizeof(struct SMB_ACL_T) + sizeof(struct acl))) == NULL) {
+ if ((a = (SMB_ACL_T)SMB_MALLOC(sizeof a[0] + sizeof (struct acl))) == NULL) {
errno = ENOMEM;
return NULL;
}
a->next = -1;
a->freeaclp = False;
- a->aclp = (struct acl *)(&a->aclp + sizeof(struct acl *));
+ a->aclp = (struct acl *)((char *)a + sizeof a[0]);
a->aclp->acl_cnt = 0;
return a;
|