summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2006-03-13 01:49:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:23 -0500
commit7ebfe2cb26b72d7fac397cfe3ceb14f244388224 (patch)
tree427699a924c2c25d0b87ea876489878a06d284be
parent1043e0d90ccb3493417f7bf05b70bdf5513bb1a3 (diff)
downloadsamba-7ebfe2cb26b72d7fac397cfe3ceb14f244388224.tar.gz
samba-7ebfe2cb26b72d7fac397cfe3ceb14f244388224.tar.xz
samba-7ebfe2cb26b72d7fac397cfe3ceb14f244388224.zip
r14280: Fix Coverity #129 and 130: check before dereferencing a pointer. This
was especially silly as we checked immediately _after_ dereferencing it :-/
-rw-r--r--source/lib/secdesc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/secdesc.c b/source/lib/secdesc.c
index 11f963fa0e8..f8873277cf8 100644
--- a/source/lib/secdesc.c
+++ b/source/lib/secdesc.c
@@ -336,11 +336,11 @@ NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, uint32
SEC_ACE *ace = 0;
NTSTATUS status;
- *sd_size = 0;
-
if (!ctx || !psd || !sid || !sd_size)
return NT_STATUS_INVALID_PARAMETER;
+ *sd_size = 0;
+
status = sec_ace_add_sid(ctx, &ace, psd[0]->dacl->ace, &psd[0]->dacl->num_aces, sid, mask);
if (!NT_STATUS_IS_OK(status))
@@ -388,11 +388,11 @@ NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, size_t
SEC_ACE *ace = 0;
NTSTATUS status;
- *sd_size = 0;
-
if (!ctx || !psd[0] || !sid || !sd_size)
return NT_STATUS_INVALID_PARAMETER;
+ *sd_size = 0;
+
status = sec_ace_del_sid(ctx, &ace, psd[0]->dacl->ace, &psd[0]->dacl->num_aces, sid);
if (!NT_STATUS_IS_OK(status))