From: Hallvard Furuseth Date: Fri, 3 Sep 1999 11:01:18 +0000 (+0000) Subject: Fix SAFEMEMCPY bug from revision 1.32 in idl_insert() X-Git-Tag: TWEB_OL_BASE~33 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5b6c6b5855a5af74d8639f9b6e3efff85b819b21;p=openldap Fix SAFEMEMCPY bug from revision 1.32 in idl_insert() --- diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index 4f61a0b472..e47c8cfa5b 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -659,8 +659,8 @@ idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids ) } /* make a slot for the new id */ - SAFEMEMCPY( &ID_BLOCK_ID(*idl, i), &ID_BLOCK_ID(*idl, i+1), - ID_BLOCK_NIDS(*idl) - i ); + SAFEMEMCPY( &ID_BLOCK_ID(*idl, i+1), &ID_BLOCK_ID(*idl, i), + (ID_BLOCK_NIDS(*idl) - i) * sizeof(ID) ); ID_BLOCK_ID(*idl, i) = id; ID_BLOCK_NIDS(*idl)++;