From 3ca34cc49f41aa2fd7c9d5ecb7264d48b5c2c0a6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Jun 2000 23:34:11 +0000 Subject: sec_desc_size() needs to handle a null secdesc (This used to be commit b152d75ea677d4025dcaaf3ae9009db0979dc402) --- source3/rpc_parse/parse_sec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/rpc_parse') 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. -- cgit