a = attr_find( rs->sr_entry->e_attrs,
slap_schema.si_ad_entryCSN );
if ( a ) {
- ber_len_t len = a->a_vals[0].bv_len;
- if ( len > pd->csn.bv_len )
- len = pd->csn.bv_len;
- if ( memcmp( a->a_vals[0].bv_val, pd->csn.bv_val, len ) > 0 ) {
- AC_MEMCPY( pd->csn.bv_val, a->a_vals[0].bv_val, len );
+ ber_len_t len = a->a_nvals[0].bv_len;
+ /* Paranoid len check, normalized CSNs are always the same length */
+ if ( len > LDAP_PVT_CSNSTR_BUFSIZE )
+ len = LDAP_PVT_CSNSTR_BUFSIZE;
+ if ( memcmp( a->a_nvals[0].bv_val, pd->csn.bv_val, len ) > 0 ) {
+ AC_MEMCPY( pd->csn.bv_val, a->a_nvals[0].bv_val, len );
pd->csn.bv_len = len;
}
}
AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
purge_data pd = {0};
char timebuf[LDAP_LUTIL_GENTIME_BUFSIZE];
- char csnbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
+ char csnbuf[LDAP_PVT_CSNSTR_BUFSIZE];
time_t old = slap_get_time();
connection_fake_init( &conn, &opbuf, ctx );
}
rdn.bv_len = snprintf( rdn.bv_val, sizeof( rdnbuf ), "%lu", op->o_connid );
- if ( rdn.bv_len >= 0 || rdn.bv_len < sizeof( rdnbuf ) ) {
+ if ( rdn.bv_len < sizeof( rdnbuf ) ) {
attr_merge_one( e, ad_reqSession, &rdn, NULL );
} /* else? */