From c322c4c76cc39cb69dd80890a9075a6f2c3fe403 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 28 Jan 2016 04:18:14 +0000 Subject: [PATCH] ITS#8363 Fix off-by-one in mdb_midl_shrink --- libraries/liblmdb/midl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c index 57a9d49..5c6d841 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;