summaryrefslogtreecommitdiff
path: root/source3/lib
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
commit2167ec9dd5bc3e0a74460bda53d9d64d19c9c899 (patch)
tree286138e70932efd0b4be43f993c5e8827f470fca /source3/lib
parent025041eba44452849f2d25f667b4c1fb6888c485 (diff)
downloadsamba-2167ec9dd5bc3e0a74460bda53d9d64d19c9c899.tar.gz
samba-2167ec9dd5bc3e0a74460bda53d9d64d19c9c899.tar.bz2
samba-2167ec9dd5bc3e0a74460bda53d9d64d19c9c899.zip
r14280: Fix Coverity #129 and 130: check before dereferencing a pointer. This
was especially silly as we checked immediately _after_ dereferencing it :-/ (This used to be commit 7ebfe2cb26b72d7fac397cfe3ceb14f244388224)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/secdesc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c
index 11f963fa0e..f8873277cf 100644
--- a/source3/lib/secdesc.c
+++ b/source3/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))