From cb614cd2d68ee6dc5c45a96b46cbf546f3869327 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 20 Jun 2012 08:42:20 +0200 Subject: idmap-hash: Fix Coverity 709118 Dereference before null check Signed-off-by: Michael Adam --- source3/winbindd/idmap_hash/idmap_hash.c | 10 +++++----- 1 file 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; -- cgit