summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-06-26 06:31:55 +0000
committerJeremy Allison <jra@samba.org>2001-06-26 06:31:55 +0000
commit96ff4b8ee260079038cd87bf0aa35fcfe498666b (patch)
treed16672fe4ca81a8640518c9ba117decb5d93a986 /source3
parent0c563186fb143e047180e3c296ea024e49f948b8 (diff)
downloadsamba-96ff4b8ee260079038cd87bf0aa35fcfe498666b.tar.gz
samba-96ff4b8ee260079038cd87bf0aa35fcfe498666b.tar.bz2
samba-96ff4b8ee260079038cd87bf0aa35fcfe498666b.zip
Ensure we always have a valid pointer on unmarshalling an SD with zero
ace entries. Jeremy. (This used to be commit 274c0f5028d41175222dfaaf446e3ed8f5687a5f)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_parse/parse_sec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c
index 7cc4d054fa..b202c2a356 100644
--- a/source3/rpc_parse/parse_sec.c
+++ b/source3/rpc_parse/parse_sec.c
@@ -211,9 +211,13 @@ BOOL sec_io_acl(char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth)
if(!prs_uint32("num_aces ", ps, depth, &psa->num_aces))
return False;
- if (UNMARSHALLING(ps) && psa->num_aces != 0) {
- /* reading */
- if((psa->ace = (SEC_ACE *)prs_alloc_mem(ps,sizeof(psa->ace[0]) * psa->num_aces)) == NULL)
+ if (UNMARSHALLING(ps)) {
+ /*
+ * Even if the num_aces is zero, allocate memory as there's a difference
+ * between a non-present DACL (allow all access) and a DACL with no ACE's
+ * (allow no access).
+ */
+ if((psa->ace = (SEC_ACE *)prs_alloc_mem(ps,sizeof(psa->ace[0]) * (psa->num_aces+1))) == NULL)
return False;
}