From: Pierangelo Masarati Date: Fri, 21 Aug 2009 17:08:48 +0000 (+0000) Subject: add pedantic checks X-Git-Tag: ACLCHECK_0~247 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=72c1b2f8212fe636b089186639277e4261c78d04;p=openldap add pedantic checks --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index b95397f472..22496b66b3 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1620,6 +1620,13 @@ syncrepl_message_to_op( op->o_tag = LBER_DEFAULT; op->o_bd = si->si_wbe; + if ( BER_BVISEMPTY( &bdn ) && !BER_BVISEMPTY( &op->o_bd->be_nsuffix[0] ) ) { + Debug( LDAP_DEBUG_ANY, + "syncrepl_message_to_op: %s got empty dn", + si->si_ridtxt, 0, 0 ); + return LDAP_OTHER; + } + while (( rc = ldap_get_attribute_ber( si->si_ld, msg, ber, &bv, &bvals ) ) == LDAP_SUCCESS ) { if ( bv.bv_val == NULL ) @@ -1857,6 +1864,13 @@ syncrepl_message_to_entry( return rc; } + if ( BER_BVISEMPTY( &bdn ) && !BER_BVISEMPTY( &op->o_bd->be_nsuffix[0] ) ) { + Debug( LDAP_DEBUG_ANY, + "syncrepl_message_to_entry: %s got empty dn", + si->si_ridtxt, 0, 0 ); + return LDAP_OTHER; + } + if ( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_DELETE ) { /* NOTE: this could be done even before decoding the DN, * although encoding errors wouldn't be detected */