From: Howard Chu Date: Sat, 7 Apr 2012 14:36:43 +0000 (-0700) Subject: ITS#7231 fix idl_append when b has only 1 element X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=494c6fa37feb69ede05b684a5e869a5707cfca40;p=openldap ITS#7231 fix idl_append when b has only 1 element --- diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 107c984192..8695552fd3 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -1377,7 +1377,12 @@ int bdb_idl_append( ID *a, ID *b ) tmp = a[1]; a[1] = b[1]; } else { - tmp = b[1]; + if (b[1] < ida) { + tmp = a[a[0]]; + a[a[0]] = b[1]; + } else { + tmp = b[1]; + } } a[0]++; a[a[0]] = tmp;