]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
tolerate that config_get_vals() returns success with no values (ITS#4341)
[openldap] / servers / slapd / add.c
index 3a022e85962e6e6ab4105473b514905283c5a553..9056e412ae07eda7200489ff8a0ff7b6f64df903 100644 (file)
@@ -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();