]> git.sur5r.net Git - openldap/commitdiff
ITS#7231 fix idl_append when b has only 1 element
authorHoward Chu <hyc@openldap.org>
Sat, 7 Apr 2012 14:36:43 +0000 (07:36 -0700)
committerHoward Chu <hyc@openldap.org>
Sat, 7 Apr 2012 14:36:43 +0000 (07:36 -0700)
servers/slapd/back-bdb/idl.c

index 107c984192b39388bf97b43ae5f5d498daab4c4d..8695552fd3291dcdfc454d732b500750159dd47a 100644 (file)
@@ -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;