summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-21 08:06:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:52 -0500
commiteb08c1fc8f877bffeaf63acfbc97ae00a4370a15 (patch)
tree94abb6435577f2aa18dce0948708d5e64b1b0207 /source4/lib/ldb/ldb_tdb
parent2a0cf520e3255d8e1bdec1bedd710489619de614 (diff)
downloadsamba-eb08c1fc8f877bffeaf63acfbc97ae00a4370a15.tar.gz
samba-eb08c1fc8f877bffeaf63acfbc97ae00a4370a15.tar.bz2
samba-eb08c1fc8f877bffeaf63acfbc97ae00a4370a15.zip
r8668: fixed a segv during upgrade of a very old ldb.
Thanks to volker for finding this one too. Keep them coming! (This used to be commit 756796ad2ea86a9471d1b09e66b1a74c4523f6f4)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 1cfebe6864..2fb6c34227 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -1001,6 +1001,11 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
/* check if the DN key has changed, perhaps due to the
case insensitivity of an element changing */
key2 = ltdb_key(module, msg->dn);
+ if (key2.dptr == NULL) {
+ /* probably a corrupt record ... darn */
+ ldb_debug(module->ldb, LDB_DEBUG_ERROR, "Invalid DN in re_index: %s\n", msg->dn);
+ return 0;
+ }
if (strcmp(key2.dptr, key.dptr) != 0) {
tdb_delete(tdb, key);
tdb_store(tdb, key2, data, 0);