From: Howard Chu Date: Thu, 11 Apr 2002 08:01:56 +0000 (+0000) Subject: ITS#1570 - avoid overflowing array when dups are present in IDLs X-Git-Tag: OPENLDAP_REL_ENG_2_MP~228 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0825e12b42d178832c0f7338645493bae5ebedba;p=openldap ITS#1570 - avoid overflowing array when dups are present in IDLs --- diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index 48a0b65f69..011a01a3be 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -1067,6 +1067,9 @@ idl_intersection( #endif for ( ni = 0, ai = 0, bi = 0; ai < ID_BLOCK_NIDS(a); ai++ ) { + if ( ID_BLOCK_ID(a, ai) < ID_BLOCK_ID(b, bi) ) { + continue; + } for ( ; bi < ID_BLOCK_NIDS(b) && ID_BLOCK_ID(b, bi) < ID_BLOCK_ID(a, ai); bi++ ) @@ -1080,6 +1083,7 @@ idl_intersection( if ( ID_BLOCK_ID(b, bi) == ID_BLOCK_ID(a, ai) ) { ID_BLOCK_ID(n, ni++) = ID_BLOCK_ID(a, ai); + bi++; } }