]> git.sur5r.net Git - openldap/commitdiff
ITS#7432 fix typo in mdb_midl_sort
authorHoward Chu <hyc@symas.com>
Mon, 5 Nov 2012 13:06:06 +0000 (05:06 -0800)
committerHoward Chu <hyc@symas.com>
Mon, 5 Nov 2012 13:06:06 +0000 (05:06 -0800)
Wasn't pushing the optimal half of the array onto the stack,
thus used more stack than expected -> overrun.

libraries/libmdb/midl.c

index 9ee100dc35f5c4e67b1956a5cef992b95a7eeb54..8de61e3d0cd8653f20f21f6c26f4f3f8f928653a 100644 (file)
@@ -232,7 +232,7 @@ mdb_midl_sort( MDB_IDL ids )
                        ids[l+1] = ids[j];
                        ids[j] = a;
                        jstack += 2;
-                       if (ir-i+1 >= j-1) {
+                       if (ir-i+1 >= j-l) {
                                istack[jstack] = ir;
                                istack[jstack-1] = i;
                                ir = j-1;