From 494c6fa37feb69ede05b684a5e869a5707cfca40 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 7 Apr 2012 07:36:43 -0700 Subject: [PATCH] ITS#7231 fix idl_append when b has only 1 element --- servers/slapd/back-bdb/idl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.39.5