summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/common/ldb_dn.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-04 20:15:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:08 -0500
commit38c4955c2ac3438526b3c590bce9a9ba259e83d4 (patch)
treeffa067168e43c059317224894b4733e2d746b78b /source3/lib/ldb/common/ldb_dn.c
parent638a16900cddacc4399c77c8e26ba43e93341499 (diff)
downloadsamba-38c4955c2ac3438526b3c590bce9a9ba259e83d4.tar.gz
samba-38c4955c2ac3438526b3c590bce9a9ba259e83d4.tar.bz2
samba-38c4955c2ac3438526b3c590bce9a9ba259e83d4.zip
r19075: Fix a potential NULL dereference
(This used to be commit 0ab5d7692c2c0fe798a067866cb236ea9c304463)
Diffstat (limited to 'source3/lib/ldb/common/ldb_dn.c')
-rw-r--r--source3/lib/ldb/common/ldb_dn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/ldb/common/ldb_dn.c b/source3/lib/ldb/common/ldb_dn.c
index 204dd3b462..a52569119f 100644
--- a/source3/lib/ldb/common/ldb_dn.c
+++ b/source3/lib/ldb/common/ldb_dn.c
@@ -674,6 +674,7 @@ static struct ldb_dn_component ldb_dn_copy_component(void *mem_ctx, struct ldb_d
dst.name = talloc_strdup(mem_ctx, src->name);
if (dst.name == NULL) {
talloc_free(dst.value.data);
+ dst.value.data = NULL;
}
return dst;
@@ -826,6 +827,9 @@ struct ldb_dn *ldb_dn_compose(void *mem_ctx, const struct ldb_dn *dn1, const str
for (i = 0; i < dn1->comp_num; i++) {
newdn->components[i] = ldb_dn_copy_component(newdn->components,
&(dn1->components[i]));
+ if (newdn->components[i].value.data == NULL) {
+ goto failed;
+ }
}
return newdn;