From: Howard Chu Date: Mon, 3 Dec 2012 21:57:28 +0000 (-0800) Subject: Fix mdb_midl_shrink X-Git-Tag: OPENLDAP_REL_ENG_2_4_34~96^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5af47adf6b02a4b260ed717944c40d6ed120577a;p=openldap Fix mdb_midl_shrink --- diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c index 8de61e3d0c..7289f405d9 100644 --- a/libraries/liblmdb/midl.c +++ b/libraries/liblmdb/midl.c @@ -132,7 +132,7 @@ void mdb_midl_free(MDB_IDL ids) int mdb_midl_shrink( MDB_IDL *idp ) { MDB_IDL ids = *idp; - if (ids[-1] > MDB_IDL_UM_MAX) { + if (*(--ids) > MDB_IDL_UM_MAX) { ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID)); *ids++ = MDB_IDL_UM_MAX; *idp = ids;