]> git.sur5r.net Git - openldap/commitdiff
Fix 6e05ca17e988754ae90fde1921765ba130bb90b2
authorHoward Chu <highlandsun@gmail.com>
Mon, 3 Oct 2011 02:52:12 +0000 (19:52 -0700)
committerHoward Chu <highlandsun@gmail.com>
Mon, 3 Oct 2011 02:52:12 +0000 (19:52 -0700)
Missed a MDB_RESERVE case

libraries/libmdb/mdb.c

index b3f4f0de9f96cf4efb0cb2f499bd3db4c0c3ad95..0ac61a3d5310aab30c3bd6c7aa25d6b13f050d35 100644 (file)
@@ -4062,7 +4062,10 @@ current:
                /* same size, just replace it */
                if (!F_ISSET(leaf->mn_flags, F_BIGDATA) &&
                        NODEDSZ(leaf) == data->mv_size) {
-                       memcpy(NODEDATA(leaf), data->mv_data, data->mv_size);
+                       if (F_ISSET(flags, MDB_RESERVE))
+                               data->mv_data = NODEDATA(leaf);
+                       else
+                               memcpy(NODEDATA(leaf), data->mv_data, data->mv_size);
                        goto done;
                }
                mdb_node_del(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], 0);