summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_hash
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-06-20 08:43:36 +0200
committerMichael Adam <obnox@samba.org>2012-06-20 10:51:14 +0200
commit963666a3feb4a140d44fe70a23ab42420dc1c45b (patch)
tree59db73853031ab7e8dde2219ebcf354c5c23bc9a /source3/winbindd/idmap_hash
parentcb614cd2d68ee6dc5c45a96b46cbf546f3869327 (diff)
downloadsamba-963666a3feb4a140d44fe70a23ab42420dc1c45b.tar.gz
samba-963666a3feb4a140d44fe70a23ab42420dc1c45b.tar.bz2
samba-963666a3feb4a140d44fe70a23ab42420dc1c45b.zip
idmap-hash: Fix Coverity ID 709117 Dereference before null check
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/winbindd/idmap_hash')
-rw-r--r--source3/winbindd/idmap_hash/idmap_hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index e7dd127e14..cb518a8c60 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -216,6 +216,11 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
int i;
+ if (!ids) {
+ nt_status = NT_STATUS_INVALID_PARAMETER;
+ BAIL_ON_NTSTATUS_ERROR(nt_status);
+ }
+
/* initialize the status to avoid suprise */
for (i = 0; ids[i]; i++) {
ids[i]->status = ID_UNKNOWN;
@@ -224,11 +229,6 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
nt_status = be_init(dom);
BAIL_ON_NTSTATUS_ERROR(nt_status);
- if (!ids) {
- nt_status = NT_STATUS_INVALID_PARAMETER;
- BAIL_ON_NTSTATUS_ERROR(nt_status);
- }
-
for (i=0; ids[i]; i++) {
struct dom_sid sid;
uint32_t rid;