From 963666a3feb4a140d44fe70a23ab42420dc1c45b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 20 Jun 2012 08:43:36 +0200 Subject: idmap-hash: Fix Coverity ID 709117 Dereference before null check Signed-off-by: Michael Adam --- source3/winbindd/idmap_hash/idmap_hash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/winbindd/idmap_hash') 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; -- cgit