From 7e3838dd2d8647e9c621a08c61a2a22ef1d94bb2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 27 Aug 2005 15:13:15 +0000 Subject: r9685: Add tests for samba3sam mapping module Fix a couple of bugs Move samba3sam backend to lib/ldb/ Remove some more unused parameters (This used to be commit 7f864d446d6af7cfd9fb8dbc496a29b36ec57ce9) --- source4/lib/ldb/ldb_map/ldb_map.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/ldb_map') diff --git a/source4/lib/ldb/ldb_map/ldb_map.c b/source4/lib/ldb/ldb_map/ldb_map.c index dea3c24e37..2082abe79a 100644 --- a/source4/lib/ldb/ldb_map/ldb_map.c +++ b/source4/lib/ldb/ldb_map/ldb_map.c @@ -126,6 +126,9 @@ static struct ldb_dn *map_remote_dn(struct ldb_module *module, const struct ldb_ struct ldb_dn *newdn; int i; + if (dn == NULL) + return NULL; + newdn = talloc_memdup(module, dn, sizeof(*dn)); if (!newdn) return NULL; @@ -183,6 +186,9 @@ static struct ldb_dn *map_local_dn(struct ldb_module *module, const struct ldb_d int i; struct ldb_parse_tree eqtree, *new_eqtree; + if (dn == NULL) + return NULL; + newdn = talloc_memdup(module, dn, sizeof(*dn)); if (!newdn) return NULL; @@ -252,8 +258,6 @@ static struct ldb_dn *map_local_dn(struct ldb_module *module, const struct ldb_d return newdn; } - - /* Loop over ldb_map_attribute array and add remote_names */ static const char **ldb_map_attrs(struct ldb_module *module, const char *const attrs[]) { @@ -261,6 +265,9 @@ static const char **ldb_map_attrs(struct ldb_module *module, const char *const a const char **ret; int ar_size = 0, last_element = 0; + if (attrs == NULL) + return NULL; + /* Start with good guess of number of elements */ for (i = 0; attrs[i]; i++); -- cgit