]> git.sur5r.net Git - openldap/commitdiff
ITS#6467, use memcpy instead for strcpy when copying across array
authorRalf Haferkamp <ralf@openldap.org>
Mon, 15 Feb 2010 15:25:47 +0000 (15:25 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Mon, 15 Feb 2010 15:25:47 +0000 (15:25 +0000)
boundaries. To account for stricter checks when using -D_FORTIFY_SOURCE=2
with GCC 4.5

servers/slapd/back-bdb/dn2id.c

index 7fd05d450771999f422fe9f109057f586fbfdc48..9b4c0392b3836cb8cad513a3bd0ff21f7714849d 100644 (file)
@@ -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 );