diff options
author | Alexander Bokovoy <ab@samba.org> | 2022-02-16 14:04:47 +0200 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2022-04-29 15:07:49 -0700 |
commit | c4c94ada3fecc28b53b84d51157bc37fb00236da (patch) | |
tree | 35df8567d9cf1af85c98d27f919f6edbc9b3a772 /setcifsacl.c | |
parent | 4ad2c50f8f22968abe84a84ef49d37806731b20e (diff) | |
download | cifs-utils-c4c94ada3fecc28b53b84d51157bc37fb00236da.tar.gz cifs-utils-c4c94ada3fecc28b53b84d51157bc37fb00236da.tar.bz2 cifs-utils-c4c94ada3fecc28b53b84d51157bc37fb00236da.zip |
setcifsacl: fix memory allocation for struct cifs_ace
We don't have 'struct cifs_aces' so the correct struct name is 'struct
cifs_ace'. The code only worked because 'struct unknown *' is compatible
with 'struct cifs_ace *'.
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'setcifsacl.c')
-rw-r--r-- | setcifsacl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/setcifsacl.c b/setcifsacl.c index c0ecd41..7ede417 100644 --- a/setcifsacl.c +++ b/setcifsacl.c @@ -492,11 +492,11 @@ build_reorder_aces(struct cifs_ace **facesptr, int numfaces) int i, numallowedaces, numdeniedaces, numallowedinhaces, numdeniedinhaces, numreorderaces; - allowedacesptr = calloc(numfaces, sizeof(struct cifs_aces *)); - deniedacesptr = calloc(numfaces, sizeof(struct cifs_aces *)); - allowedinhacesptr = calloc(numfaces, sizeof(struct cifs_aces *)); - deniedinhacesptr = calloc(numfaces, sizeof(struct cifs_aces *)); - reorderacesptr = calloc(numfaces, sizeof(struct cifs_aces *)); + allowedacesptr = calloc(numfaces, sizeof(struct cifs_ace *)); + deniedacesptr = calloc(numfaces, sizeof(struct cifs_ace *)); + allowedinhacesptr = calloc(numfaces, sizeof(struct cifs_ace *)); + deniedinhacesptr = calloc(numfaces, sizeof(struct cifs_ace *)); + reorderacesptr = calloc(numfaces, sizeof(struct cifs_ace *)); numallowedaces = 0; numdeniedaces = 0; @@ -631,7 +631,7 @@ ace_add_reorder(struct cifs_ntsd *pntsd, struct cifs_ntsd **npntsd, ssize_t *buf int i, rc, numaces; numaces = numfaces + numcaces; - totalacesptr = calloc(numaces, sizeof(struct cifs_aces *)); + totalacesptr = calloc(numaces, sizeof(struct cifs_ace *)); for (i = 0; i < numfaces; i++) { totalacesptr[i] = facesptr[i]; @@ -780,7 +780,7 @@ build_fetched_aces(char *aclptr, int numfaces) char *acl_base; struct cifs_ace *pace, **facesptr; - facesptr = calloc(numfaces, sizeof(struct cifs_aces *)); + facesptr = calloc(numfaces, sizeof(struct cifs_ace *)); if (!facesptr) { fprintf(stderr, "%s: Error %d allocating ACE array", __func__, errno); @@ -1112,7 +1112,7 @@ build_cmdline_aces(char **arrptr, int numcaces, ace_kinds ace_kind) char *acesid, *acetype, *aceflag, *acemask; struct cifs_ace **cacesptr; - cacesptr = calloc(numcaces, sizeof(struct cifs_aces *)); + cacesptr = calloc(numcaces, sizeof(struct cifs_ace *)); if (!cacesptr) { fprintf(stderr, "%s: Error %d allocating ACE array", __func__, errno); |