From: Pierangelo Masarati Date: Sat, 7 Aug 2010 22:34:36 +0000 (+0000) Subject: quick fix for ITS#6616; root cause not clear yet X-Git-Tag: MIGRATION_CVS2GIT~528 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4fbbedcf29281503fb963947375f6fd9dc72be5e;p=openldap quick fix for ITS#6616; root cause not clear yet --- diff --git a/servers/slapd/back-sql/entry-id.c b/servers/slapd/back-sql/entry-id.c index 417a8a23a2..6cef98dde6 100644 --- a/servers/slapd/back-sql/entry-id.c +++ b/servers/slapd/back-sql/entry-id.c @@ -925,19 +925,26 @@ backsql_id2entry( backsql_srch_info *bsi, backsql_entryID *eid ) goto done; } - ber_dupbv_x( &bsi->bsi_e->e_name, &eid->eid_dn, op->o_tmpmemctx ); - ber_dupbv_x( &bsi->bsi_e->e_nname, &eid->eid_ndn, op->o_tmpmemctx ); - bsi->bsi_e->e_attrs = NULL; bsi->bsi_e->e_private = NULL; if ( eid->eid_oc == NULL ) { eid->eid_oc = backsql_id2oc( bsi->bsi_op->o_bd->be_private, eid->eid_oc_id ); + if ( eid->eid_oc == NULL ) { + Debug( LDAP_DEBUG_TRACE, + "backsql_id2entry(): unable to fetch objectClass with id=%lu for entry id=" BACKSQL_IDFMT " dn=\"%s\"\n", + eid->eid_oc_id, BACKSQL_IDARG(eid->eid_id), + eid->eid_dn.bv_val ); + return LDAP_OTHER; + } } bsi->bsi_oc = eid->eid_oc; bsi->bsi_c_eid = eid; + ber_dupbv_x( &bsi->bsi_e->e_name, &eid->eid_dn, op->o_tmpmemctx ); + ber_dupbv_x( &bsi->bsi_e->e_nname, &eid->eid_ndn, op->o_tmpmemctx ); + #ifndef BACKSQL_ARBITRARY_KEY /* FIXME: unused */ bsi->bsi_e->e_id = eid->eid_id;