mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 09:09:54 -05:00
fix off-by-one bug; use s/sprintf/snprintf/
This commit is contained in:
parent
43167d0fa6
commit
d2ee0b1758
1 changed files with 7 additions and 4 deletions
|
|
@ -563,10 +563,13 @@ op_ldap_modrdn(
|
|||
if ( ldap_debug & LDAP_DEBUG_ARGS ) {
|
||||
char buf[ 256 ];
|
||||
char *buf2;
|
||||
sprintf( buf, "%s:%d", ri->ri_hostname, ri->ri_port );
|
||||
buf2 = (char *) ch_malloc( strlen( re->re_dn ) + strlen( mi->mi_val )
|
||||
+ 10 );
|
||||
sprintf( buf2, "(\"%s\" -> \"%s\")", re->re_dn, mi->mi_val );
|
||||
int buf2len = strlen( re->re_dn ) + strlen( mi->mi_val ) + 11;
|
||||
|
||||
snprintf( buf, sizeof(buf), "%s:%d", ri->ri_hostname, ri->ri_port );
|
||||
|
||||
buf2 = (char *) ch_malloc( buf2len );
|
||||
snprintf( buf2, buf2len, "(\"%s\" -> \"%s\")", re->re_dn, mi->mi_val );
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG (( "ldap_op", LDAP_LEVEL_ARGS,
|
||||
"op_ldap_modrdn: replica %s - modify rdn %s (flag: %d)\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue