From 5e1a84c43ed0c69ca97499370d97c182e5d903e1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 28 Dec 2015 17:01:47 +0100 Subject: [PATCH] winbind: Properly error check init_lsa_ref_domain_list Signed-off-by: Volker Lendecke Reviewed-by: Uri Simchoni --- source3/winbindd/wb_sids2xids.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c index e3962de269b..940a06bd1c0 100644 --- a/source3/winbindd/wb_sids2xids.c +++ b/source3/winbindd/wb_sids2xids.c @@ -184,16 +184,22 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq) struct lsa_DomainInfo *info; struct lsa_TranslatedName *n = &names->names[i]; struct wbint_TransID *t = &state->ids.ids[i]; + int domain_index; sid_copy(&dom_sid, &state->non_cached[i]); sid_split_rid(&dom_sid, &t->rid); info = &domains->domains[n->sid_index]; t->type = lsa_SidType_to_id_type(n->sid_type); - t->domain_index = init_lsa_ref_domain_list(state, - state->idmap_doms, - info->name.string, - &dom_sid); + + domain_index = init_lsa_ref_domain_list( + state, state->idmap_doms, info->name.string, &dom_sid); + if (domain_index == -1) { + tevent_req_oom(req); + return; + } + t->domain_index = domain_index; + t->xid.id = UINT32_MAX; t->xid.type = t->type; } -- 2.34.1