summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_hash
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-06-20 08:42:20 +0200
committerMichael Adam <obnox@samba.org>2012-06-20 10:51:14 +0200
commitcb614cd2d68ee6dc5c45a96b46cbf546f3869327 (patch)
tree63f06d39780fbc344f192a10a83a8a091ffda4db /source3/winbindd/idmap_hash
parent0f65745277d7ba73156593670a6d60b0883176fd (diff)
downloadsamba-cb614cd2d68ee6dc5c45a96b46cbf546f3869327.tar.gz
samba-cb614cd2d68ee6dc5c45a96b46cbf546f3869327.tar.bz2
samba-cb614cd2d68ee6dc5c45a96b46cbf546f3869327.zip
idmap-hash: Fix Coverity 709118 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 1f36b217ef..e7dd127e14 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -166,6 +166,11 @@ static NTSTATUS unixids_to_sids(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;
@@ -174,11 +179,6 @@ static NTSTATUS unixids_to_sids(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++) {
uint32_t h_domain, h_rid;