add pedantic checks

This commit is contained in:
Pierangelo Masarati 2009-08-21 17:08:48 +00:00
parent 53fca03374
commit 72c1b2f821

View File

@ -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 */