summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-04 23:34:11 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-04 23:34:11 +0000
commit3ca34cc49f41aa2fd7c9d5ecb7264d48b5c2c0a6 (patch)
tree0595e83ca6eac8468416044833bbbb6700f4fb96 /source3
parent7ed09de569ac48646f26c6f5e347239bf84c4dcd (diff)
downloadsamba-3ca34cc49f41aa2fd7c9d5ecb7264d48b5c2c0a6.tar.gz
samba-3ca34cc49f41aa2fd7c9d5ecb7264d48b5c2c0a6.tar.bz2
samba-3ca34cc49f41aa2fd7c9d5ecb7264d48b5c2c0a6.zip
sec_desc_size() needs to handle a null secdesc
(This used to be commit b152d75ea677d4025dcaaf3ae9009db0979dc402)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_parse/parse_sec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c
index 2aba894834..51cf52f706 100644
--- a/source3/rpc_parse/parse_sec.c
+++ b/source3/rpc_parse/parse_sec.c
@@ -256,7 +256,11 @@ BOOL sec_io_acl(char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth)
size_t sec_desc_size(SEC_DESC *psd)
{
- size_t offset = SD_HEADER_SIZE;
+ size_t offset;
+
+ if (!psd) return 0;
+
+ offset = SD_HEADER_SIZE;
if (psd->owner_sid != NULL)
offset += ((sid_size(psd->owner_sid) + 3) & ~3);
@@ -411,7 +415,6 @@ SEC_DESC *make_standard_sec_desc(DOM_SID *owner_sid, DOM_SID *grp_sid,
owner_sid, grp_sid, NULL, dacl, sd_size);
}
-
/*******************************************************************
Reads or writes a SEC_DESC structure.
If reading and the *ppsd = NULL, allocates the structure.