From: Howard Chu Date: Thu, 28 Jan 2016 04:18:14 +0000 (+0000) Subject: ITS#8363 Fix off-by-one in mdb_midl_shrink X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5bf313e820b8a6e122510e4571d9c6a3ec0136c1;p=openldap ITS#8363 Fix off-by-one in mdb_midl_shrink --- diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c index e2005d16cf..152a1ec0dd 100644 --- a/libraries/liblmdb/midl.c +++ b/libraries/liblmdb/midl.c @@ -120,7 +120,7 @@ void mdb_midl_shrink( MDB_IDL *idp ) { MDB_IDL ids = *idp; if (*(--ids) > MDB_IDL_UM_MAX && - (ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID)))) + (ids = realloc(ids, (MDB_IDL_UM_MAX+2) * sizeof(MDB_ID)))) { *ids++ = MDB_IDL_UM_MAX; *idp = ids;