From: Ralf Haferkamp Date: Mon, 15 Feb 2010 15:25:47 +0000 (+0000) Subject: ITS#6467, use memcpy instead for strcpy when copying across array X-Git-Tag: MIGRATION_CVS2GIT~698 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5ceb2cd4e0f4e766be0bc10211a734b7791f3a32;p=openldap ITS#6467, use memcpy instead for strcpy when copying across array boundaries. To account for stricter checks when using -D_FORTIFY_SOURCE=2 with GCC 4.5 --- diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 7fd05d4507..9b4c0392b3 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -680,7 +680,7 @@ hdb_dn2id_delete( d->nrdnlen[0] = (BEI(e)->bei_nrdn.bv_len >> 8) | 0x80; dlen[0] = d->nrdnlen[0]; dlen[1] = d->nrdnlen[1]; - strcpy( d->nrdn, BEI(e)->bei_nrdn.bv_val ); + memcpy( d->nrdn, BEI(e)->bei_nrdn.bv_val, BEI(e)->bei_nrdn.bv_len+1 ); data.data = d; rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );