]> git.sur5r.net Git - openldap/commitdiff
Fix MDB_CURRENT updating for dupsort items
authorHoward Chu <hyc@openldap.org>
Sat, 26 Jan 2013 18:55:35 +0000 (18:55 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 26 Jan 2013 18:55:35 +0000 (18:55 +0000)
libraries/liblmdb/mdb.c

index e5013d6d56ad4e872309fdeeedfcb5c938e376f8..575e494487640b73641eaa4cc09a4afe006e696e 100644 (file)
@@ -5064,8 +5064,10 @@ current:
                         */
                        if (F_ISSET(flags, MDB_RESERVE))
                                data->mv_data = NODEDATA(leaf);
-                       else
+                       else if (data->mv_size)
                                memcpy(NODEDATA(leaf), data->mv_data, data->mv_size);
+                       else
+                               memcpy(NODEKEY(leaf), key->mv_data, key->mv_size);
                        goto done;
                }
                mdb_node_del(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], 0);