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 ) );
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);
if ( isprint( (unsigned char) *p )) {
++p;
} else {
- SAFEMEMCPY( p, p + 1, strlen( p + 1 ) + 1 );
+ AC_MEMCPY( p, p + 1, strlen( p + 1 ) + 1 );
}
}
* 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 );
}
tmptag >>= 8;
}
- SAFEMEMCPY( (*sos)->sos_first,
+ AC_FMEMCPY( (*sos)->sos_first,
&nettag[sizeof(ber_tag_t) - taglen],
taglen );
}
/* 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 );
}
* 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 );
}
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;
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 );
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 );
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;
}
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;
return( NULL );
}
- SAFEMEMCPY( p, s, len );
+ AC_MEMCPY( p, s, len );
return( p );
}
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;
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;
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 ) {
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;
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 );
}
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 ) {
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 );
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;
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 ));
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 */
}
/* 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;
*f++ = ' ';
}
slen = strlen( valwords[ i ] );
- SAFEMEMCPY( f, valwords[ i ], slen );
+ AC_MEMCPY( f, valwords[ i ], slen );
f += slen;
}
}
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;
}
*len = ktxt.length;
- memcpy( cred, ktxt.dat, ktxt.length );
+ AC_MEMCPY( cred, ktxt.dat, ktxt.length );
return( cred );
}
}
/* 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;
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;
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);
}
/* 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;
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 );
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 )
# 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
char **tgt=*tgtio;
for( ; (*src) ; src++ ) {
len = strlen( *src ) + 1;
- memcpy( buf, *src, len );
+ AC_MEMCPY( buf, *src, len );
*tgt++=buf;
buf+=len;
}
{
char **tgt=*tgtio;
for( ; (*src) ; src++ ) {
- memcpy( buf, *src, len );
+ AC_MEMCPY( buf, *src, len );
*tgt++=buf;
buf+=len;
}
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;
}
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 );
}
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
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
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
} else {
- memcpy(ret.dptr, (void *)(out.key.dptr + delta),
+ AC_MEMCPY(ret.dptr, (void *)(out.key.dptr + delta),
ret.dsize );
}
return -1;
}
p = newp;
- SAFEMEMCPY( &p[total], buffer, bytes );
+ AC_MEMCPY( &p[total], buffer, bytes );
total += bytes;
}
ber_memfree( freeme );
return( -1 );
}
- memcpy( p, value, vlen );
+ AC_MEMCPY( p, value, vlen );
p[vlen] = '\0';
value = p;
}
* 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));
}
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);
}
* 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));
}
* 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));
}
* 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));
}
}
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;
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);
}
lutil_MD5Final( digest, &ctx );
- memcpy( &buf[n], digest,
+ AC_MEMCPY( &buf[n], digest,
nbytes - n >= 16 ? 16 : nbytes - n );
}
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;
/* 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;
/* Handle any remaining bytes of data. */
- memcpy(ctx->in, buf, len);
+ AC_MEMCPY(ctx->in, buf, len);
}
/*
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;
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';
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,
#ifdef SHA1HANDSOFF
uint32 block[16];
- (void)memcpy(block, buffer, 64);
+ (void)AC_MEMCPY(block, buffer, 64);
#else
uint32 *block = (u_int32 *) buffer;
#endif
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]);
} else {
i = 0;
}
- (void)memcpy(&context->buffer[j], &data[i], len - i);
+ (void)AC_MEMCPY(&context->buffer[j], &data[i], len - i);
}
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);
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 */
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;
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;
return( NOID );
}
- (void) memcpy( (char *) &id, data.dptr, sizeof(ID) );
+ AC_MEMCPY( (char *) &id, data.dptr, sizeof(ID) );
assert( id != NOID );
* (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 );
}
continue;
}
- SAFEMEMCPY(
+ AC_MEMCPY(
(char *) &ID_BLOCK_ID(idl, nids),
(char *) &ID_BLOCK_ID(tmp[i], 0),
ID_BLOCK_NIDS(tmp[i]) * sizeof(ID) );
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) );
}
/* 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) );
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 );
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) );
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) );
}
/* 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;
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) );
{
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));
} 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));
new = idl_alloc( ID_BLOCK_NMAX(idl) );
- SAFEMEMCPY(
+ AC_MEMCPY(
(char *) new,
(char *) idl,
(ID_BLOCK_NMAX(idl) + ID_BLOCK_IDS_OFFSET) * sizeof(ID) );
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 {
return NOID;
}
- memcpy( &id, key.dptr, key.dsize );
+ AC_MEMCPY( &id, key.dptr, key.dsize );
ldbm_datum_free( id2entry->dbc_db, key );
return NOID;
}
- memcpy( &id, key.dptr, key.dsize );
+ AC_MEMCPY( &id, key.dptr, key.dsize );
ldbm_datum_free( id2entry->dbc_db, key );
/* 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++;
} 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;
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 ) );
}
}
}
}
#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 );
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, "*" );
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;
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 )
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;
} 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 ) ) {
set_dispose(set);
return(NULL);
}
- memcpy(attrstr, attr, attrlen);
+ AC_MEMCPY(attrstr, attr, attrlen);
attrstr[attrlen] = 0;
nset = ch_calloc(1, sizeof(char *));
*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;
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;
} 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;
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;
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 {
perror( "malloc" );
exit( EXIT_FAILURE );
}
- SAFEMEMCPY( bvp->bv_val, value, vlen );
+ AC_MEMCPY( bvp->bv_val, value, vlen );
bvp->bv_val[ vlen ] = '\0';
}
}