summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-14 16:54:55 +0100
committerGünther Deschner <gd@samba.org>2013-01-02 12:35:36 +0100
commitab14918ea406eed2ed79c39dea7b855e4ecbac74 (patch)
tree4348e2a6089bb613fcc5ad8cf21b3394353dfec6 /source3/winbindd
parent6cb7c4f45e1657245443c3bcc6dab219e5f1d9b5 (diff)
downloadsamba-ab14918ea406eed2ed79c39dea7b855e4ecbac74.tar.gz
samba-ab14918ea406eed2ed79c39dea7b855e4ecbac74.tar.bz2
samba-ab14918ea406eed2ed79c39dea7b855e4ecbac74.zip
s3-idmap: Check return value of string_to_sid().
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap_autorid.c7
1 files changed, 6 insertions, 1 deletions
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 -