From 0ab5d7692c2c0fe798a067866cb236ea9c304463 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 4 Oct 2006 20:15:23 +0000 Subject: [PATCH] r19075: Fix a potential NULL dereference --- source/lib/ldb/common/ldb_dn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/lib/ldb/common/ldb_dn.c b/source/lib/ldb/common/ldb_dn.c index 204dd3b4626..a52569119fc 100644 --- a/source/lib/ldb/common/ldb_dn.c +++ b/source/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; -- 2.11.4.GIT