summaryrefslogtreecommitdiffstats
path: root/source/rpc_parse/parse_sec.c
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
commitb152d75ea677d4025dcaaf3ae9009db0979dc402 (patch)
treef628de28d5534dd74e8e49a1e663d5374ba1e00b /source/rpc_parse/parse_sec.c
parent70476d6767a571460fa375fb1dae884df77ca143 (diff)
downloadsamba-b152d75ea677d4025dcaaf3ae9009db0979dc402.tar.gz
samba-b152d75ea677d4025dcaaf3ae9009db0979dc402.tar.xz
samba-b152d75ea677d4025dcaaf3ae9009db0979dc402.zip
sec_desc_size() needs to handle a null secdesc
Diffstat (limited to 'source/rpc_parse/parse_sec.c')
-rw-r--r--source/rpc_parse/parse_sec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/rpc_parse/parse_sec.c b/source/rpc_parse/parse_sec.c
index 2aba894834f..51cf52f706d 100644
--- a/source/rpc_parse/parse_sec.c
+++ b/source/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.