From: Claude Brisson Date: Fri, 22 Mar 2013 15:00:21 +0000 (+0100) Subject: bugfix for mdb_cursor_put with MDB_MULTIPLE X-Git-Tag: OPENLDAP_REL_ENG_2_4_35~10^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bbb27cde4af7d9f60ca77b4b0caea4b6237ed289;p=openldap bugfix for mdb_cursor_put with MDB_MULTIPLE If the variable dkey.mv_size is non-zero, then it means dkey contains some original data which has to be put back in the child db, typically when the child db has just been created. But when using MDB_MULTIPLE, if this variable has not been reset to zero, we may come back to this section and wrongly think that there is some original data to be taken care of. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index cf306fcb77..3329565893 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5218,6 +5218,8 @@ put_sub: } } } + /* we've done our job */ + dkey.mv_size = 0; } if (flags & MDB_APPENDDUP) xflags |= MDB_APPEND;