From: Howard Chu Date: Tue, 24 Nov 2009 03:41:24 +0000 (+0000) Subject: ITS#6400 clarify... X-Git-Tag: ACLCHECK_0~56 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3b2380254ac28200e977d355bee8ed65446ebd0d;p=openldap ITS#6400 clarify... --- diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 8e5907e96a..d9a576b775 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -580,11 +580,12 @@ log_old_lookup( Operation *op, SlapReply *rs ) 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; } }