summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_map
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/ldb_map')
-rw-r--r--source4/lib/ldb/ldb_map/ldb_map.c11
1 files changed, 9 insertions, 2 deletions
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++);