diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 3a022e8596..9056e412ae 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -668,9 +668,9 @@ int slap_add_opattrs( ptr = ber_bvchr( &csn, '#' ); if ( ptr ) { timestamp.bv_len = ptr - csn.bv_val; - if ( timestamp.bv_len >= sizeof(timebuf) ) + if ( timestamp.bv_len >= sizeof(timebuf) ) /* ?!? */ timestamp.bv_len = sizeof(timebuf) - 1; - strncpy( timebuf, csn.bv_val, timestamp.bv_len ); + AC_MEMCPY( timebuf, csn.bv_val, timestamp.bv_len ); timebuf[timestamp.bv_len] = '\0'; } else { time_t now = slap_get_time();