From: Kurt Zeilenga Date: Fri, 28 Jul 2000 01:07:07 +0000 (+0000) Subject: s/SAFEMEMCPY/AC_MEMCPY/ X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2329 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5b856458a259f83b9dd3182eb3a924b82cac4906;p=openldap s/SAFEMEMCPY/AC_MEMCPY/ Use AC_FMEMCPY where appropriate (-llber) --- diff --git a/clients/ud/print.c b/clients/ud/print.c index 9275f6d07c..6f9afab387 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -603,7 +603,7 @@ time2text( char *ldtimestr, int dateonly ) timestr[ strlen( timestr ) - 1 ] = zone; /* replace trailing newline */ if ( dateonly ) { - SAFEMEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 ); + AC_MEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 ); } return( strdup( timestr ) ); diff --git a/clients/ud/string_to_key.c b/clients/ud/string_to_key.c index 120cde80cf..66d2eb6643 100644 --- a/clients/ud/string_to_key.c +++ b/clients/ud/string_to_key.c @@ -208,13 +208,13 @@ StringToKey( strncat (password, cell, sizeof(password)-passlen); if ((passlen = strlen(password)) > sizeof(password)) passlen = sizeof(password); - memcpy(ivec, "kerberos", 8); - memcpy(temp_key, "kerberos", 8); + AC_MEMCPY(ivec, "kerberos", 8); + AC_MEMCPY(temp_key, "kerberos", 8); des_fixup_key_parity (temp_key); des_key_sched (temp_key, schedule); des_cbc_cksum (password, ivec, passlen, schedule, ivec); - memcpy(temp_key, ivec, 8); + AC_MEMCPY(temp_key, ivec, 8); des_fixup_key_parity (temp_key); des_key_sched (temp_key, schedule); des_cbc_cksum (password, key, passlen, schedule, ivec); diff --git a/clients/ud/util.c b/clients/ud/util.c index 603d2c770d..16253263a4 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -92,7 +92,7 @@ fetch_buffer( char *buffer, int length, FILE *where ) if ( isprint( (unsigned char) *p )) { ++p; } else { - SAFEMEMCPY( p, p + 1, strlen( p + 1 ) + 1 ); + AC_MEMCPY( p, p + 1, strlen( p + 1 ) + 1 ); } } diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 00bcf197af..ff3bf64be3 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -533,7 +533,7 @@ ber_put_seqorset( BerElement *ber ) * the length field. Move the data if * we don't actually need that much */ - SAFEMEMCPY( (*sos)->sos_first + taglen + + AC_MEMCPY( (*sos)->sos_first + taglen + lenlen, (*sos)->sos_first + taglen + FOUR_BYTE_LEN, len ); } @@ -583,7 +583,7 @@ ber_put_seqorset( BerElement *ber ) tmptag >>= 8; } - SAFEMEMCPY( (*sos)->sos_first, + AC_FMEMCPY( (*sos)->sos_first, &nettag[sizeof(ber_tag_t) - taglen], taglen ); @@ -594,12 +594,12 @@ ber_put_seqorset( BerElement *ber ) } /* one byte of length length */ - SAFEMEMCPY( (*sos)->sos_first + 1, <ag, 1 ); + (*sos)->sos_first[1] = ltag; if ( ber->ber_options & LBER_USE_DER ) { if (lenlen > 1) { /* Write the length itself */ - SAFEMEMCPY( (*sos)->sos_first + 2, + AC_FMEMCPY( (*sos)->sos_first + 2, &netlen[sizeof(ber_len_t) - (lenlen - 1)], lenlen - 1 ); } @@ -609,13 +609,13 @@ ber_put_seqorset( BerElement *ber ) * the length field. Move the data if * we don't actually need that much */ - SAFEMEMCPY( (*sos)->sos_first + taglen + + AC_FMEMCPY( (*sos)->sos_first + taglen + lenlen, (*sos)->sos_first + taglen + FOUR_BYTE_LEN, len ); } } else { /* the length itself */ - SAFEMEMCPY( (*sos)->sos_first + taglen + 1, + AC_FMEMCPY( (*sos)->sos_first + taglen + 1, &netlen[sizeof(ber_len_t) - (FOUR_BYTE_LEN - 1)], FOUR_BYTE_LEN - 1 ); } diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 05773e900b..6de4335ca2 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -88,7 +88,7 @@ ber_read( nleft = ber->ber_end - ber->ber_ptr; actuallen = nleft < len ? nleft : len; - SAFEMEMCPY( buf, ber->ber_ptr, actuallen ); + AC_MEMCPY( buf, ber->ber_ptr, actuallen ); ber->ber_ptr += actuallen; @@ -112,7 +112,7 @@ ber_write( if ( ber_realloc( ber, len ) != 0 ) return( -1 ); } - SAFEMEMCPY( ber->ber_ptr, buf, (size_t)len ); + AC_MEMCPY( ber->ber_ptr, buf, (size_t)len ); ber->ber_ptr += len; return( (ber_slen_t) len ); @@ -121,7 +121,7 @@ ber_write( if ( ber_realloc( ber, len ) != 0 ) return( -1 ); } - SAFEMEMCPY( ber->ber_sos->sos_ptr, buf, (size_t)len ); + AC_MEMCPY( ber->ber_sos->sos_ptr, buf, (size_t)len ); ber->ber_sos->sos_ptr += len; ber->ber_sos->sos_clen += len; return( (ber_slen_t) len ); @@ -392,7 +392,7 @@ int ber_flatten( return( -1 ); } - SAFEMEMCPY( bv->bv_val, ber->ber_buf, len ); + AC_MEMCPY( bv->bv_val, ber->ber_buf, len ); bv->bv_val[len] = '\0'; bv->bv_len = len; } diff --git a/libraries/liblber/memory.c b/libraries/liblber/memory.c index a500569cdc..861dd3a23a 100644 --- a/libraries/liblber/memory.c +++ b/libraries/liblber/memory.c @@ -473,7 +473,7 @@ ber_bvdup( return NULL; } - SAFEMEMCPY( new->bv_val, bv->bv_val, bv->bv_len ); + AC_MEMCPY( new->bv_val, bv->bv_val, bv->bv_len ); new->bv_val[bv->bv_len] = '\0'; new->bv_len = bv->bv_len; @@ -564,6 +564,6 @@ ber_strdup( LDAP_CONST char *s ) return( NULL ); } - SAFEMEMCPY( p, s, len ); + AC_MEMCPY( p, s, len ); return( p ); } diff --git a/libraries/liblber/options.c b/libraries/liblber/options.c index 0b6ded358f..3689f0df58 100644 --- a/libraries/liblber/options.c +++ b/libraries/liblber/options.c @@ -124,7 +124,7 @@ ber_set_option( return LBER_OPT_ERROR; } - memcpy(ber_int_memory_fns, f, sizeof(BerMemoryFunctions)); + AC_MEMCPY(ber_int_memory_fns, f, sizeof(BerMemoryFunctions)); ber_int_options.lbo_valid = LBER_INITIALIZED; return LBER_OPT_SUCCESS; diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index 3899206fc5..06fd8bd937 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -239,7 +239,7 @@ ber_pvt_sb_copy_out( Sockbuf_Buf *sbb, char *buf, ber_len_t len ) max = sbb->buf_end - sbb->buf_ptr; max = ( max < len) ? max : len; if ( max ) { - memcpy( buf, sbb->buf_base + sbb->buf_ptr, max ); + AC_MEMCPY( buf, sbb->buf_base + sbb->buf_ptr, max ); sbb->buf_ptr += max; if ( sbb->buf_ptr >= sbb->buf_end ) sbb->buf_ptr = sbb->buf_end = 0; @@ -658,7 +658,7 @@ sb_dgram_ctrl( Sockbuf_IO_Desc *sbiod, int opt, void *arg ) p = (struct dgram_data *)sbiod->sbiod_pvt; if ( opt == LBER_SB_OPT_UDP_SET_DST ) { - memcpy( &p->dst, arg, sizeof( struct sockaddr ) ); + AC_MEMCPY( &p->dst, arg, sizeof( struct sockaddr ) ); return 1; } else if ( opt == LBER_SB_OPT_UDP_GET_SRC ) { diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 93e0e31083..82212582c1 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -240,7 +240,7 @@ ldap_add_request_to_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) ld->ld_errno = LDAP_NO_MEMORY; return; } - SAFEMEMCPY( new->lm_ber->ber_buf, request->ber_buf, + AC_MEMCPY( new->lm_ber->ber_buf, request->ber_buf, (size_t)len ); new->lm_ber->ber_ptr = new->lm_ber->ber_buf; new->lm_ber->ber_end = new->lm_ber->ber_buf + len; @@ -498,7 +498,7 @@ msg_dup( LDAPMessage *msg ) LDAP_FREE( (char *)new ); return( NULL ); } - SAFEMEMCPY( new->lm_ber->ber_buf, msg->lm_ber->ber_buf, + AC_MEMCPY( new->lm_ber->ber_buf, msg->lm_ber->ber_buf, (size_t)len ); new->lm_ber->ber_ptr = new->lm_ber->ber_buf + ( msg->lm_ber->ber_ptr - msg->lm_ber->ber_buf ); diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index 50839df1fa..1ec30c88e4 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -139,7 +139,7 @@ cldap_open( LDAP_CONST char *host, int port ) } for ( i = 0; hp->h_addr_list[ i ] != 0; ++i ) { - SAFEMEMCPY( (char *)&sock.sin_addr, + AC_MEMCPY( (char *)&sock.sin_addr, (char *)hp->h_addr_list[ i ], sizeof(sock.sin_addr)); if ( add_addr( ld, (struct sockaddr *)&sock ) < 0 ) { @@ -287,7 +287,7 @@ add_addr( LDAP *ld, struct sockaddr *sap ) return( -1 ); } - SAFEMEMCPY( (char *)newsap, (char *)sap, sizeof( struct sockaddr )); + AC_MEMCPY( (char *)newsap, (char *)sap, sizeof( struct sockaddr )); addrs[ ld->ld_cldapnaddr++ ] = newsap; ld->ld_cldapaddrs = (void **)addrs; return( 0 ); diff --git a/libraries/libldap/controls.c b/libraries/libldap/controls.c index 5c69588e42..6a814b80fe 100644 --- a/libraries/libldap/controls.c +++ b/libraries/libldap/controls.c @@ -348,7 +348,7 @@ ldap_control_dup( const LDAPControl *c ) return NULL; } - SAFEMEMCPY( new->ldctl_value.bv_val, c->ldctl_value.bv_val, + AC_MEMCPY( new->ldctl_value.bv_val, c->ldctl_value.bv_val, c->ldctl_value.bv_len ); new->ldctl_value.bv_len = c->ldctl_value.bv_len; diff --git a/libraries/libldap/dsparse.c b/libraries/libldap/dsparse.c index 57d80a541c..2b7771c5bd 100644 --- a/libraries/libldap/dsparse.c +++ b/libraries/libldap/dsparse.c @@ -135,7 +135,7 @@ next_line( char **bufp, ber_len_t *blenp, char **linep ) return( -1 ); /* fatal error */ } - (void) memcpy( line, linestart, p - linestart ); + AC_MEMCPY( line, linestart, p - linestart ); line[ p - linestart - 1 ] = '\0'; *linep = line; return( strlen( line )); diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 0d8b488e19..3ed841ab5e 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -334,7 +334,7 @@ explode_name( const char *name, int notypes, int is_type ) if (( parts[ count-1 ] = (char *)LDAP_CALLOC( 1, len + 1 )) != NULL ) { - SAFEMEMCPY( parts[ count-1 ], rdn, len ); + AC_MEMCPY( parts[ count-1 ], rdn, len ); if( !endquote ) { /* skip trailing spaces */ diff --git a/libraries/libldap/getentry.c b/libraries/libldap/getentry.c index ccdca5ea40..66d40656ad 100644 --- a/libraries/libldap/getentry.c +++ b/libraries/libldap/getentry.c @@ -104,7 +104,7 @@ ldap_get_entry_controls( } /* make a local copy of the BerElement */ - SAFEMEMCPY(&be, entry->lm_ber, sizeof(be)); + AC_MEMCPY(&be, entry->lm_ber, sizeof(be)); if ( ber_scanf( &be, "{xx" /*}*/ ) == LBER_ERROR ) { rc = LDAP_DECODING_ERROR; diff --git a/libraries/libldap/getfilter.c b/libraries/libldap/getfilter.c index c837631e6d..9939ae88ac 100644 --- a/libraries/libldap/getfilter.c +++ b/libraries/libldap/getfilter.c @@ -370,7 +370,7 @@ ldap_build_filter( *f++ = ' '; } slen = strlen( valwords[ i ] ); - SAFEMEMCPY( f, valwords[ i ], slen ); + AC_MEMCPY( f, valwords[ i ], slen ); f += slen; } } @@ -379,17 +379,17 @@ ldap_build_filter( if ( wordcount > 0 ) { wordnum = wordcount - 1; slen = strlen( valwords[ wordnum ] ); - SAFEMEMCPY( f, valwords[ wordnum ], slen ); + AC_MEMCPY( f, valwords[ wordnum ], slen ); f += slen; } } else if ( value != NULL ) { slen = strlen( value ); - SAFEMEMCPY( f, value, slen ); + AC_MEMCPY( f, value, slen ); f += slen; } } else if ( *p == 'a' && attr != NULL ) { slen = strlen( attr ); - SAFEMEMCPY( f, attr, slen ); + AC_MEMCPY( f, attr, slen ); f += slen; } else { *f++ = *p; diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index 65fb0d2e03..240c3f7b24 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -275,7 +275,7 @@ ldap_get_kerberosv4_credentials( } *len = ktxt.length; - memcpy( cred, ktxt.dat, ktxt.length ); + AC_MEMCPY( cred, ktxt.dat, ktxt.length ); return( cred ); } diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 4ee3c1b269..4b2176a2a4 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -135,7 +135,7 @@ ldap_create( LDAP **ldp ) } /* copy the global options */ - memcpy(&ld->ld_options, gopts, sizeof(ld->ld_options)); + AC_MEMCPY(&ld->ld_options, gopts, sizeof(ld->ld_options)); ld->ld_valid = LDAP_VALID_SESSION; diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 805e0223f5..c2143561a1 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -74,7 +74,7 @@ ldap_int_timeval_dup( struct timeval **dest, const struct timeval *src ) return 1; } - SAFEMEMCPY( (char *) new, (const char *) src, sizeof(struct timeval)); + AC_MEMCPY( (char *) new, (const char *) src, sizeof(struct timeval)); *dest = new; return 0; @@ -394,7 +394,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, sin.sin_port = port; p = (char *)&sin.sin_addr; q = use_hp ? (char *)hp->h_addr_list[i] : (char *)&address; - SAFEMEMCPY(p, q, sizeof(sin.sin_addr) ); + AC_MEMCPY(p, q, sizeof(sin.sin_addr) ); osip_debug(ld, "ldap_connect_to_host: Trying %s:%d\n", inet_ntoa(sin.sin_addr),ntohs(sin.sin_port),0); diff --git a/libraries/libldap/references.c b/libraries/libldap/references.c index 9336aa9417..6a6d723356 100644 --- a/libraries/libldap/references.c +++ b/libraries/libldap/references.c @@ -105,7 +105,7 @@ ldap_parse_reference( } /* make a private copy of BerElement */ - SAFEMEMCPY(&be, ref->lm_ber, sizeof(be)); + AC_MEMCPY(&be, ref->lm_ber, sizeof(be)); if ( ber_scanf( &be, "{v" /*}*/, &refs ) == LBER_ERROR ) { rc = LDAP_DECODING_ERROR; diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index 385312256f..10a45aac58 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -938,7 +938,7 @@ time2text( char *ldtimestr, int dateonly ) timestr[ strlen( timestr ) - 1 ] = zone; /* replace trailing newline */ if ( dateonly ) { - SAFEMEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 ); + AC_MEMCPY( timestr + 11, timestr + 20, strlen( timestr + 20 ) + 1 ); } return( timestr ); diff --git a/libraries/libldap/ufn.c b/libraries/libldap/ufn.c index db21748c8d..ec79348fec 100644 --- a/libraries/libldap/ufn.c +++ b/libraries/libldap/ufn.c @@ -98,7 +98,7 @@ ldap_ufn_search_ctx( LDAP *ld, char **ufncomp, int ncomp, char *prefix, if ( (quote = strrchr( ufncomp[ncomp], '"' )) != NULL ) *quote = '\0'; - SAFEMEMCPY( ufncomp[ncomp], ufncomp[ncomp] + 1, + AC_MEMCPY( ufncomp[ncomp], ufncomp[ncomp] + 1, strlen( ufncomp[ncomp] + 1 ) + 1 ); } if ( ncomp == 0 ) diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c index b0484034a5..126b573cb2 100644 --- a/libraries/libldap/util-int.c +++ b/libraries/libldap/util-int.c @@ -83,7 +83,7 @@ char *ldap_pvt_ctime( const time_t *tp, char *buf ) # ifdef LDAP_R_COMPILE ldap_pvt_thread_mutex_lock( &ldap_int_ctime_mutex ); # endif - memcpy( buf, ctime(tp), 26 ); + AC_MEMCPY( buf, ctime(tp), 26 ); # ifdef LDAP_R_COMPILE ldap_pvt_thread_mutex_unlock( &ldap_int_ctime_mutex ); # endif @@ -288,7 +288,7 @@ static char *cpy_aliases( char ***tgtio, char *buf, char **src ) char **tgt=*tgtio; for( ; (*src) ; src++ ) { len = strlen( *src ) + 1; - memcpy( buf, *src, len ); + AC_MEMCPY( buf, *src, len ); *tgt++=buf; buf+=len; } @@ -300,7 +300,7 @@ static char *cpy_addresses( char ***tgtio, char *buf, char **src, int len ) { char **tgt=*tgtio; for( ; (*src) ; src++ ) { - memcpy( buf, *src, len ); + AC_MEMCPY( buf, *src, len ); *tgt++=buf; buf+=len; } @@ -343,9 +343,9 @@ static int copy_hostent( struct hostent *res, char **buf, struct hostent * src ) if (safe_realloc( buf, total_len )) { tp = (char **) *buf; tbuf = *buf + (n_alias + n_addr + 2) * sizeof( char * ); - memcpy( res, src, sizeof( struct hostent ) ); + AC_MEMCPY( res, src, sizeof( struct hostent ) ); /* first the name... */ - memcpy( tbuf, src->h_name, name_len ); + AC_MEMCPY( tbuf, src->h_name, name_len ); res->h_name = tbuf; tbuf+=name_len; /* now the aliases */ res->h_aliases = tp; diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index 3e6825ac0a..8b857f630d 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -51,7 +51,7 @@ ldbm_datum_dup( LDBM ldbm, Datum data ) } dup.dsize = data.dsize; if ( (dup.dptr = (char *) malloc( data.dsize )) != NULL ) - memcpy( dup.dptr, data.dptr, data.dsize ); + AC_MEMCPY( dup.dptr, data.dptr, data.dsize ); return( dup ); } @@ -811,7 +811,7 @@ ldbm_fetch( LDBM ldbm, Datum key ) k.key.dsize = key.dsize + 1; k.key.dptr = malloc(k.key.dsize); *(k.key.dptr) = 'l'; - memcpy( (void *)(k.key.dptr + 1), key.dptr, key.dsize ); + AC_MEMCPY( (void *)(k.key.dptr + 1), key.dptr, key.dsize ); #else k.key = key; #endif @@ -879,7 +879,7 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) int_key.dsize = key.dsize + 1; int_key.dptr = malloc( int_key.dsize ); *(int_key.dptr) = 'l'; /* Must not be NULL !*/ - memcpy( (void *)(int_key.dptr + 1), key.dptr, key.dsize ); + AC_MEMCPY( (void *)(int_key.dptr + 1), key.dptr, key.dsize ); #else int_key = key; #endif @@ -918,7 +918,7 @@ ldbm_delete( LDBM ldbm, Datum key ) int_key.dsize = key.dsize + 1; int_key.dptr = malloc(int_key.dsize); *(int_key.dptr) = 'l'; - memcpy( (void *)(int_key.dptr + 1), key.dptr, key.dsize ); + AC_MEMCPY( (void *)(int_key.dptr + 1), key.dptr, key.dsize ); #else int_key = key; #endif @@ -974,7 +974,7 @@ ldbm_get_next( LDBM ldbm, kvpair (*fptr)(MDBM *, kvpair) ) } else { - memcpy(ret.dptr, (void *)(out.key.dptr + delta), + AC_MEMCPY(ret.dptr, (void *)(out.key.dptr + delta), ret.dsize ); } diff --git a/libraries/libldif/fetch.c b/libraries/libldif/fetch.c index daf9034598..1f62be80e0 100644 --- a/libraries/libldif/fetch.c +++ b/libraries/libldif/fetch.c @@ -80,7 +80,7 @@ ldif_fetch_url( return -1; } p = newp; - SAFEMEMCPY( &p[total], buffer, bytes ); + AC_MEMCPY( &p[total], buffer, bytes ); total += bytes; } diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index e4a85a226d..e101cd9e3e 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -231,7 +231,7 @@ done: ber_memfree( freeme ); return( -1 ); } - memcpy( p, value, vlen ); + AC_MEMCPY( p, value, vlen ); p[vlen] = '\0'; value = p; } diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index 836a2ef69f..0aa9d9354d 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -446,7 +446,7 @@ add_decomp(unsigned long code) * Shift the decomps up by one if the codes don't match. */ for (j = decomps_used; j > i; j--) - (void) memcpy((char *) &decomps[j], (char *) &decomps[j - 1], + (void) AC_MEMCPY((char *) &decomps[j], (char *) &decomps[j - 1], sizeof(_decomp_t)); } @@ -470,7 +470,7 @@ add_decomp(unsigned long code) decomps[i].code = code; decomps[i].used = dectmp_size; - (void) memcpy((char *) decomps[i].decomp, (char *) dectmp, + (void) AC_MEMCPY((char *) decomps[i].decomp, (char *) dectmp, sizeof(unsigned long) * dectmp_size); } @@ -504,7 +504,7 @@ add_title(unsigned long code) * Shift the array up by one. */ for (j = title_used; j > i; j--) - (void) memcpy((char *) &title[j], (char *) &title[j - 1], + (void) AC_MEMCPY((char *) &title[j], (char *) &title[j - 1], sizeof(_case_t)); } @@ -551,7 +551,7 @@ add_upper(unsigned long code) * Shift the array up by one. */ for (j = upper_used; j > i; j--) - (void) memcpy((char *) &upper[j], (char *) &upper[j - 1], + (void) AC_MEMCPY((char *) &upper[j], (char *) &upper[j - 1], sizeof(_case_t)); } @@ -598,7 +598,7 @@ add_lower(unsigned long code) * Shift the array up by one. */ for (j = lower_used; j > i; j--) - (void) memcpy((char *) &lower[j], (char *) &lower[j - 1], + (void) AC_MEMCPY((char *) &lower[j], (char *) &lower[j - 1], sizeof(_case_t)); } diff --git a/libraries/liblunicode/ure/ure.c b/libraries/liblunicode/ure/ure.c index 51821f97f1..e36e9c0a9d 100644 --- a/libraries/liblunicode/ure/ure.c +++ b/libraries/liblunicode/ure/ure.c @@ -1113,7 +1113,7 @@ _ure_make_symbol(ucs2_t *sym, unsigned long limit, unsigned long *consumed, } symbol.id = b->symtab_used++; - (void) memcpy((char *) &b->symtab[symbol.id], (char *) &symbol, + (void) AC_MEMCPY((char *) &b->symtab[symbol.id], (char *) &symbol, sizeof(_ure_symtab_t)); return symbol.id; @@ -1347,7 +1347,7 @@ _ure_add_state(ucs2_t nstates, ucs2_t *states, _ure_buffer_t *b) sp->st.slist_size = sp->st.slist_used + nstates; } sp->st.slist_used = nstates; - (void) memcpy((char *) sp->st.slist, (char *) states, + (void) AC_MEMCPY((char *) sp->st.slist, (char *) states, sizeof(ucs2_t) * nstates); } diff --git a/libraries/liblutil/entropy.c b/libraries/liblutil/entropy.c index 1759f7dee1..13e9d9dd25 100644 --- a/libraries/liblutil/entropy.c +++ b/libraries/liblutil/entropy.c @@ -140,7 +140,7 @@ int lutil_entropy( char *buf, ber_len_t nbytes ) lutil_MD5Final( digest, &ctx ); - memcpy( &buf[n], digest, + AC_MEMCPY( &buf[n], digest, nbytes - n >= 16 ? 16 : nbytes - n ); } diff --git a/libraries/liblutil/md5.c b/libraries/liblutil/md5.c index 9ce509f8ff..9e14cc2a4a 100644 --- a/libraries/liblutil/md5.c +++ b/libraries/liblutil/md5.c @@ -110,10 +110,10 @@ lutil_MD5Update( t = 64-t; if (len < t) { - memcpy(p, buf, len); + AC_MEMCPY(p, buf, len); return; } - memcpy(p, buf, t); + AC_MEMCPY(p, buf, t); lutil_MD5Transform(ctx->buf, ctx->in); buf += t; len -= t; @@ -122,7 +122,7 @@ lutil_MD5Update( /* Process data in 64-byte chunks */ while (len >= 64) { - memcpy(ctx->in, buf, 64); + AC_MEMCPY(ctx->in, buf, 64); lutil_MD5Transform(ctx->buf, ctx->in); buf += 64; len -= 64; @@ -130,7 +130,7 @@ lutil_MD5Update( /* Handle any remaining bytes of data. */ - memcpy(ctx->in, buf, len); + AC_MEMCPY(ctx->in, buf, len); } /* diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index f6f791066b..68c2709ab6 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -351,8 +351,8 @@ static struct berval * pw_string( return NULL; } - memcpy( pw->bv_val, sc->name.bv_val, sc->name.bv_len ); - memcpy( &pw->bv_val[sc->name.bv_len], passwd->bv_val, passwd->bv_len ); + AC_MEMCPY( pw->bv_val, sc->name.bv_val, sc->name.bv_len ); + AC_MEMCPY( &pw->bv_val[sc->name.bv_len], passwd->bv_val, passwd->bv_len ); pw->bv_val[pw->bv_len] = '\0'; return pw; @@ -380,9 +380,9 @@ static struct berval * pw_string64( return NULL; } - memcpy( string.bv_val, hash->bv_val, + AC_MEMCPY( string.bv_val, hash->bv_val, hash->bv_len ); - memcpy( &string.bv_val[hash->bv_len], salt->bv_val, + AC_MEMCPY( &string.bv_val[hash->bv_len], salt->bv_val, salt->bv_len ); string.bv_val[string.bv_len] = '\0'; @@ -400,7 +400,7 @@ static struct berval * pw_string64( return NULL; } - memcpy(b64->bv_val, sc->name.bv_val, sc->name.bv_len); + AC_MEMCPY(b64->bv_val, sc->name.bv_val, sc->name.bv_len); rc = lutil_b64_ntop( string.bv_val, string.bv_len, diff --git a/libraries/liblutil/sha1.c b/libraries/liblutil/sha1.c index b3e608b606..9d97ceb169 100644 --- a/libraries/liblutil/sha1.c +++ b/libraries/liblutil/sha1.c @@ -71,7 +71,7 @@ lutil_SHA1Transform( uint32 *state, const unsigned char *buffer ) #ifdef SHA1HANDSOFF uint32 block[16]; - (void)memcpy(block, buffer, 64); + (void)AC_MEMCPY(block, buffer, 64); #else uint32 *block = (u_int32 *) buffer; #endif @@ -151,7 +151,7 @@ lutil_SHA1Update( context->count[1] += (len>>29)+1; j = (j >> 3) & 63; if ((j + len) > 63) { - (void)memcpy(&context->buffer[j], data, (i = 64-j)); + (void)AC_MEMCPY(&context->buffer[j], data, (i = 64-j)); lutil_SHA1Transform(context->state, context->buffer); for ( ; i + 63 < len; i += 64) lutil_SHA1Transform(context->state, &data[i]); @@ -159,7 +159,7 @@ lutil_SHA1Update( } else { i = 0; } - (void)memcpy(&context->buffer[j], &data[i], len - i); + (void)AC_MEMCPY(&context->buffer[j], &data[i], len - i); } diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 205e72106b..2e74071b31 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -879,7 +879,7 @@ aci_bvstrdup( struct berval *bv ) s = (char *)ch_malloc(bv->bv_len + 1); if (s != NULL) { - memcpy(s, bv->bv_val, bv->bv_len); + AC_MEMCPY(s, bv->bv_val, bv->bv_len); s[bv->bv_len] = 0; } return(s); diff --git a/servers/slapd/add.c b/servers/slapd/add.c index e45ded2ae6..d159ea8631 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -301,7 +301,7 @@ static int slap_mods2entry( sizeof( struct berval * ) * (i+j) ); /* should check for duplicates */ - memcpy( &attr->a_vals[i], mods->sml_bvalues, + AC_MEMCPY( &attr->a_vals[i], mods->sml_bvalues, sizeof( struct berval * ) * j ); /* trim the mods array */ diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 811dd59803..25c1d7589b 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -247,7 +247,7 @@ at_add( return SLAP_SCHERR_ATTR_INCOMPLETE; } sat = (AttributeType *) ch_calloc( 1, sizeof(AttributeType) ); - memcpy( &sat->sat_atype, at, sizeof(LDAPAttributeType)); + AC_MEMCPY( &sat->sat_atype, at, sizeof(LDAPAttributeType)); sat->sat_cname = cname; diff --git a/servers/slapd/back-ldbm/alias.c b/servers/slapd/back-ldbm/alias.c index 5f44fb4841..d37dfeb3ab 100644 --- a/servers/slapd/back-ldbm/alias.c +++ b/servers/slapd/back-ldbm/alias.c @@ -279,8 +279,8 @@ char* new_superior( newDN = ch_malloc( dnlen - olen + nlen + 1 ); - memcpy( newDN, dn, dnlen - olen ); - memcpy( &newDN[dnlen - olen], newSup, nlen ); + AC_MEMCPY( newDN, dn, dnlen - olen ); + AC_MEMCPY( &newDN[dnlen - olen], newSup, nlen ); newDN[dnlen - olen + nlen] = '\0'; return newDN; diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index ca614d978a..81f1154a85 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -139,7 +139,7 @@ dn2id( return( NOID ); } - (void) memcpy( (char *) &id, data.dptr, sizeof(ID) ); + AC_MEMCPY( (char *) &id, data.dptr, sizeof(ID) ); assert( id != NOID ); diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index 1cdaa750d4..13ac4235b0 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -25,7 +25,7 @@ static void cont_alloc( Datum *cont, Datum *key ) * (unsigned char *) cont->dptr = SLAP_INDEX_CONT_PREFIX; - memcpy( &((unsigned char *)cont->dptr)[1 + sizeof(ID)], + AC_MEMCPY( &((unsigned char *)cont->dptr)[1 + sizeof(ID)], key->dptr, key->dsize ); } @@ -196,7 +196,7 @@ idl_fetch( continue; } - SAFEMEMCPY( + AC_MEMCPY( (char *) &ID_BLOCK_ID(idl, nids), (char *) &ID_BLOCK_ID(tmp[i], 0), ID_BLOCK_NIDS(tmp[i]) * sizeof(ID) ); @@ -275,7 +275,7 @@ idl_split_block( ID_BLOCK_NIDS(*right) = 1; ID_BLOCK_ID(*right, 0) = id; } else { - SAFEMEMCPY( + AC_MEMCPY( (char *) &ID_BLOCK_ID(*right, 0), (char *) &ID_BLOCK_ID(b, 0), nr * sizeof(ID) ); @@ -284,7 +284,7 @@ idl_split_block( } /* the id being inserted & everything after in the second block */ - SAFEMEMCPY( + AC_MEMCPY( (char *) &ID_BLOCK_ID(*left, (nr == 0 ? 0 : 1)), (char *) &ID_BLOCK_ID(b, nr), nl * sizeof(ID) ); @@ -517,7 +517,7 @@ idl_insert_key( k3.dptr = ch_malloc(k2.dsize); k3.dsize = k2.dsize; - memcpy(k3.dptr, k2.dptr, k3.dsize); + AC_MEMCPY(k3.dptr, k2.dptr, k3.dsize); if ( (rc = idl_store( be, db, k3, tmp )) != 0 ) { Debug( LDAP_DEBUG_ANY, "idl_insert_key: idl_store returned %d\n", rc, 0, 0 ); @@ -612,7 +612,7 @@ split: tmp = idl_alloc( ID_BLOCK_NMAX(idl) + 1 ); ID_BLOCK_NIDS(tmp) = ID_BLOCK_INDIRECT_VALUE; /* everything up to the split block */ - SAFEMEMCPY( + AC_MEMCPY( (char *) &ID_BLOCK_ID(tmp, 0), (char *) &ID_BLOCK_ID(idl, 0), i * sizeof(ID) ); @@ -620,7 +620,7 @@ split: ID_BLOCK_ID(tmp, i) = ID_BLOCK_ID(tmp2, 0); ID_BLOCK_ID(tmp, i + 1) = ID_BLOCK_ID(tmp3, 0); /* everything after the split block */ - SAFEMEMCPY( + AC_MEMCPY( (char *) &ID_BLOCK_ID(tmp, i + 2), (char *) &ID_BLOCK_ID(idl, i + 1), (ID_BLOCK_NMAX(idl) - i - 1) * sizeof(ID) ); @@ -690,7 +690,7 @@ idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids ) } /* make a slot for the new id */ - SAFEMEMCPY( &ID_BLOCK_ID(*idl, i+1), &ID_BLOCK_ID(*idl, i), + AC_MEMCPY( &ID_BLOCK_ID(*idl, i+1), &ID_BLOCK_ID(*idl, i), (ID_BLOCK_NIDS(*idl) - i) * sizeof(ID) ); ID_BLOCK_ID(*idl, i) = id; @@ -735,7 +735,7 @@ idl_delete_key ( ldbm_cache_delete( db, key ); } else { - SAFEMEMCPY ( + AC_MEMCPY( &ID_BLOCK_ID(idl, i), &ID_BLOCK_ID(idl, i+1), (ID_BLOCK_NIDS(idl)-i) * sizeof(ID) ); @@ -779,7 +779,7 @@ idl_delete_key ( { if ( ID_BLOCK_ID(tmp, i) == id ) { - SAFEMEMCPY( + AC_MEMCPY( &ID_BLOCK_ID(tmp, i), &ID_BLOCK_ID(tmp, i+1), (ID_BLOCK_NIDS(tmp)-(i+1)) * sizeof(ID)); @@ -791,7 +791,7 @@ idl_delete_key ( } else { ldbm_cache_delete( db, data ); - SAFEMEMCPY( + AC_MEMCPY( &ID_BLOCK_ID(idl, j), &ID_BLOCK_ID(idl, j+1), (nids-(j+1)) * sizeof(ID)); @@ -829,7 +829,7 @@ idl_dup( ID_BLOCK *idl ) new = idl_alloc( ID_BLOCK_NMAX(idl) ); - SAFEMEMCPY( + AC_MEMCPY( (char *) new, (char *) idl, (ID_BLOCK_NMAX(idl) + ID_BLOCK_IDS_OFFSET) * sizeof(ID) ); diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index 37cbfc5f05..c92cbaab78 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -40,7 +40,7 @@ next_id_read( Backend *be ) data = ldbm_cache_fetch( db, key ); if( data.dptr != NULL ) { - memcpy( &id, data.dptr, sizeof( ID ) ); + AC_MEMCPY( &id, data.dptr, sizeof( ID ) ); ldbm_datum_free( db->dbc_db, data ); } else { diff --git a/servers/slapd/back-ldbm/tools.c b/servers/slapd/back-ldbm/tools.c index 2cf78c9cb4..68d2a28969 100644 --- a/servers/slapd/back-ldbm/tools.c +++ b/servers/slapd/back-ldbm/tools.c @@ -84,7 +84,7 @@ ID ldbm_tool_entry_first( return NOID; } - memcpy( &id, key.dptr, key.dsize ); + AC_MEMCPY( &id, key.dptr, key.dsize ); ldbm_datum_free( id2entry->dbc_db, key ); @@ -109,7 +109,7 @@ ID ldbm_tool_entry_next( return NOID; } - memcpy( &id, key.dptr, key.dsize ); + AC_MEMCPY( &id, key.dptr, key.dsize ); ldbm_datum_free( id2entry->dbc_db, key ); diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 780e3b9cc3..a5963c6544 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -159,13 +159,13 @@ int backend_add(BackendInfo *aBackendInfo) /* if backendInfo == binfo no deallocation of old backendInfo */ if (backendInfo == binfo) { newBackendInfo = ch_calloc(nBackendInfo + 1, sizeof(BackendInfo)); - memcpy(newBackendInfo, backendInfo, sizeof(BackendInfo) * + AC_MEMCPY(newBackendInfo, backendInfo, sizeof(BackendInfo) * nBackendInfo); } else { newBackendInfo = ch_realloc(backendInfo, sizeof(BackendInfo) * (nBackendInfo + 1)); } - memcpy(&newBackendInfo[nBackendInfo], aBackendInfo, + AC_MEMCPY(&newBackendInfo[nBackendInfo], aBackendInfo, sizeof(BackendInfo)); backendInfo = newBackendInfo; nBackendInfo++; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 6c12ae0aac..01ee0a1cd7 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -882,12 +882,12 @@ strtok_quote( char *line, char *sep ) } else { inquote = 1; } - SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); + AC_MEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); break; case '\\': if ( next[1] ) - SAFEMEMCPY( next, + AC_MEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); next++; /* dont parse the escaped character */ break; diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 74c7063dec..59c4143b77 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -348,7 +348,7 @@ static Listener * open_listener( const char* url ) return NULL; } - memcpy( &l.sl_addr.sin_addr, he->h_addr, + AC_MEMCPY( &l.sl_addr.sin_addr, he->h_addr, sizeof( l.sl_addr.sin_addr ) ); } } @@ -731,8 +731,8 @@ slapd_daemon_task( } } #else - memcpy( &readfds, &slap_daemon.sd_readers, sizeof(fd_set) ); - memcpy( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) ); + AC_MEMCPY( &readfds, &slap_daemon.sd_readers, sizeof(fd_set) ); + AC_MEMCPY( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) ); #endif assert(!FD_ISSET(wake_sds[0], &readfds)); FD_SET( wake_sds[0], &readfds ); diff --git a/servers/slapd/kerberos.c b/servers/slapd/kerberos.c index 66825e5a64..344247cf56 100644 --- a/servers/slapd/kerberos.c +++ b/servers/slapd/kerberos.c @@ -32,7 +32,7 @@ krbv4_ldap_auth( Debug( LDAP_DEBUG_TRACE, "=> kerberosv4_ldap_auth\n", 0, 0, 0 ); - SAFEMEMCPY( ktxt->dat, cred->bv_val, cred->bv_len ); + AC_MEMCPY( ktxt->dat, cred->bv_val, cred->bv_len ); ktxt->length = cred->bv_len; strcpy( instance, "*" ); diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index 983a85d038..1f1257da97 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -125,7 +125,7 @@ mr_add( int code; smr = (MatchingRule *) ch_calloc( 1, sizeof(MatchingRule) ); - memcpy( &smr->smr_mrule, mr, sizeof(LDAPMatchingRule)); + AC_MEMCPY( &smr->smr_mrule, mr, sizeof(LDAPMatchingRule)); smr->smr_usage = usage; smr->smr_convert = convert; diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index c531021400..8ffd3d43c0 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -338,7 +338,7 @@ oc_add( int code; soc = (ObjectClass *) ch_calloc( 1, sizeof(ObjectClass) ); - memcpy( &soc->soc_oclass, oc, sizeof(LDAPObjectClass) ); + AC_MEMCPY( &soc->soc_oclass, oc, sizeof(LDAPObjectClass) ); if( soc->soc_sup_oids == NULL && soc->soc_kind == LDAP_SCHEMA_STRUCTURAL ) diff --git a/servers/slapd/result.c b/servers/slapd/result.c index c1616099db..d6c3bd4b52 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -49,7 +49,7 @@ static char *v2ref( struct berval **ref, const char *text ) for( i=0; ref[i] != NULL; i++ ) { v2 = ch_realloc( v2, len + ref[i]->bv_len + 1 ); v2[len-1] = '\n'; - memcpy(&v2[len], ref[i]->bv_val, ref[i]->bv_len ); + AC_MEMCPY(&v2[len], ref[i]->bv_val, ref[i]->bv_len ); len += ref[i]->bv_len; if (ref[i]->bv_val[ref[i]->bv_len-1] != '/') ++len; diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 468b316720..51db9b7247 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1666,7 +1666,7 @@ objectIdentifierFirstComponentMatch( } else { char *stored = ch_malloc( oid.bv_len + 1 ); - memcpy( stored, oid.bv_val, oid.bv_len ); + AC_MEMCPY( stored, oid.bv_val, oid.bv_len ); stored[oid.bv_len] = '\0'; if ( !strcmp( syntax->ssyn_oid, SLAP_SYNTAX_MATCHINGRULES_OID ) ) { diff --git a/servers/slapd/sets.c b/servers/slapd/sets.c index be0a60263e..d5c021f4dc 100644 --- a/servers/slapd/sets.c +++ b/servers/slapd/sets.c @@ -135,7 +135,7 @@ set_chase (SET_GATHER gatherer, void *cookie, char **set, char *attr, int attrle set_dispose(set); return(NULL); } - memcpy(attrstr, attr, attrlen); + AC_MEMCPY(attrstr, attr, attrlen); attrstr[attrlen] = 0; nset = ch_calloc(1, sizeof(char *)); @@ -287,7 +287,7 @@ set_filter (SET_GATHER gatherer, void *cookie, char *filter, char *user, char *t *set = ch_calloc(len + 1, sizeof(char)); if (*set == NULL) SF_ERROR(memory); - memcpy(*set, &filter[-len - 1], len); + AC_MEMCPY(*set, &filter[-len - 1], len); SF_PUSH(set); set = NULL; break; diff --git a/servers/slapd/syntax.c b/servers/slapd/syntax.c index 7229fb3773..9b9e01c809 100644 --- a/servers/slapd/syntax.c +++ b/servers/slapd/syntax.c @@ -118,7 +118,7 @@ syn_add( ssyn = (Syntax *) ch_calloc( 1, sizeof(Syntax) ); - memcpy( &ssyn->ssyn_syn, syn, sizeof(LDAPSyntax) ); + AC_MEMCPY( &ssyn->ssyn_syn, syn, sizeof(LDAPSyntax) ); ssyn->ssyn_next = NULL; diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index d91a70aa23..670ceeb8ae 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -173,12 +173,12 @@ strtok_quote( } else { inquote = 1; } - SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); + AC_MEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); break; case '\\': if ( next[1] ) - SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); + AC_MEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); next++; /* dont parse the escaped character */ break; diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index df1780c49e..2718ede4e8 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -184,7 +184,7 @@ Re_parse( break; case T_DN: re->re_dn = ch_malloc( len + 1 ); - memcpy( re->re_dn, value, len ); + AC_MEMCPY( re->re_dn, value, len ); re->re_dn[ len ]='\0'; state |= GOT_DN; break; @@ -234,7 +234,7 @@ Re_parse( re->re_mods[ nml ].mi_type = strdup( type ); if ( value != NULL ) { re->re_mods[ nml ].mi_val = ch_malloc( len + 1 ); - memcpy( re->re_mods[ nml ].mi_val, value, len ); + AC_MEMCPY( re->re_mods[ nml ].mi_val, value, len ); re->re_mods[ nml ].mi_val[ len ] = '\0'; re->re_mods[ nml ].mi_len = len; } else { diff --git a/tests/progs/slapd-addel.c b/tests/progs/slapd-addel.c index b555f71d64..09849483e0 100644 --- a/tests/progs/slapd-addel.c +++ b/tests/progs/slapd-addel.c @@ -173,7 +173,7 @@ addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, char *value, int vlen ) perror( "malloc" ); exit( EXIT_FAILURE ); } - SAFEMEMCPY( bvp->bv_val, value, vlen ); + AC_MEMCPY( bvp->bv_val, value, vlen ); bvp->bv_val[ vlen ] = '\0'; } }