Skip to content

Commit c322c4c

Browse files
committed
ITS#8363 Fix off-by-one in mdb_midl_shrink
1 parent c06c3c7 commit c322c4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/liblmdb/midl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void mdb_midl_shrink( MDB_IDL *idp )
120120
{
121121
MDB_IDL ids = *idp;
122122
if (*(--ids) > MDB_IDL_UM_MAX &&
123-
(ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID))))
123+
(ids = realloc(ids, (MDB_IDL_UM_MAX+2) * sizeof(MDB_ID))))
124124
{
125125
*ids++ = MDB_IDL_UM_MAX;
126126
*idp = ids;

0 commit comments

Comments
 (0)