From a4d2c63a61fca123d7f54aa84c79ba4b496242a9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 13 Jun 2005 21:25:51 +0000 Subject: [PATCH] ITS#3773 additional fix --- servers/slapd/back-bdb/dn2id.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 69f80dd2f6..5d8644306e 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -557,6 +557,7 @@ hdb_dn2id_delete( diskNode *d; int rc, nrlen; ID nid; + unsigned char dlen[2]; DBTzero(&key); key.size = sizeof(ID); @@ -586,13 +587,16 @@ hdb_dn2id_delete( d = op->o_tmpalloc( data.size, op->o_tmpmemctx ); d->nrdnlen[1] = BEI(e)->bei_nrdn.bv_len & 0xff; d->nrdnlen[0] = (BEI(e)->bei_nrdn.bv_len >> 8) | 0x80; + dlen[0] = d->nrdnlen[0]; + dlen[1] = d->nrdnlen[1]; strcpy( d->nrdn, BEI(e)->bei_nrdn.bv_val ); data.data = d; /* Delete our ID from the parent's list */ rc = cursor->c_get( cursor, &key, &data, DB_GET_BOTH_RANGE ); if ( rc == 0 ) { - if ( !strcmp( d->nrdn, BEI(e)->bei_nrdn.bv_val )) + if ( dlen[1] == d->nrdnlen[1] && dlen[0] != d->nrdnlen[0] && + !strcmp( d->nrdn, BEI(e)->bei_nrdn.bv_val )) rc = cursor->c_del( cursor, 0 ); else rc = DB_NOTFOUND; -- 2.39.5