From ab14918ea406eed2ed79c39dea7b855e4ecbac74 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 14 Dec 2012 16:54:55 +0100 Subject: s3-idmap: Check return value of string_to_sid(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner Reviewed-by: Christian Ambach --- source3/winbindd/idmap_autorid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c index 621cae98ef..b7b168970b 100644 --- a/source3/winbindd/idmap_autorid.c +++ b/source3/winbindd/idmap_autorid.c @@ -248,6 +248,7 @@ static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg, char *keystr; struct dom_sid sid; NTSTATUS status; + bool ok; /* can this be one of our ids? */ if (map->xid.id < cfg->minvalue) { @@ -297,8 +298,12 @@ static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg, return idmap_autorid_map_id_to_sid(dom, map); } - string_to_sid(&sid, (const char *)data.dptr); + ok = string_to_sid(&sid, (const char *)data.dptr); TALLOC_FREE(data.dptr); + if (!ok) { + map->status = ID_UNKNOWN; + return NT_STATUS_OK; + } sid_compose(map->sid, &sid, (map->xid.id - cfg->minvalue - -- cgit