ITS#8363 Fix off-by-one in mdb_midl_shrink

mdb.RE/0.9
Howard Chu 9 years ago
parent c06c3c7732
commit c322c4c76c
  1. 2
      libraries/liblmdb/midl.c

@ -120,7 +120,7 @@ void mdb_midl_shrink( MDB_IDL *idp )
{ {
MDB_IDL ids = *idp; MDB_IDL ids = *idp;
if (*(--ids) > MDB_IDL_UM_MAX && 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; *ids++ = MDB_IDL_UM_MAX;
*idp = ids; *idp = ids;

Loading…
Cancel
Save