summaryrefslogtreecommitdiffstats
path: root/source/lib/ldb/common/ldb_ldif.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-30 00:43:26 +0000
committerJelmer Vernooij <jelmer@samba.org>2005-08-30 00:43:26 +0000
commit814ea5b90d445b2d59f17f85a53f33ceb39a50ea (patch)
tree05aeb2ad6c740a3c7426889e02170ca029fbda09 /source/lib/ldb/common/ldb_ldif.c
parent409cc1555e44c119124b5fd66893b0f7029cd37b (diff)
downloadsamba-814ea5b90d445b2d59f17f85a53f33ceb39a50ea.tar.gz
samba-814ea5b90d445b2d59f17f85a53f33ceb39a50ea.tar.xz
samba-814ea5b90d445b2d59f17f85a53f33ceb39a50ea.zip
r9771: - Prevent ldb crash when a invalid DN is added
- Don't silently drop records with empty attributes tridge/simo: Could you please verify this patch is correct?
Diffstat (limited to 'source/lib/ldb/common/ldb_ldif.c')
-rw-r--r--source/lib/ldb/common/ldb_ldif.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/lib/ldb/common/ldb_ldif.c b/source/lib/ldb/common/ldb_ldif.c
index 38866d70313..a5768b97965 100644
--- a/source/lib/ldb/common/ldb_ldif.c
+++ b/source/lib/ldb/common/ldb_ldif.c
@@ -590,6 +590,12 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
msg->dn = ldb_dn_explode(msg, value.data);
+ if (msg->dn == NULL) {
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Unable to parse dn '%s'\n",
+ value.data);
+ goto failed;
+ }
+
while (next_attr(ldif, &s, &attr, &value) == 0) {
const struct ldb_attrib_handler *h;
struct ldb_message_element *el;