mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 16:34:14 +08:00
mdbx: don't memcpy when src eq dest.
Workaround for 'destination overlaps source' from Valgrind. Change-Id: Ib12eacbd224057334311816346ea0ccece2b42cf
This commit is contained in:
parent
8791e3243f
commit
4d3e349c16
4
mdb.c
4
mdb.c
@ -7383,14 +7383,14 @@ update:
|
||||
memcpy(ndata, data->mv_data, sizeof(pgno_t));
|
||||
else if (F_ISSET(flags, MDB_RESERVE))
|
||||
data->mv_data = ndata;
|
||||
else
|
||||
else if (ndata != data->mv_data)
|
||||
memcpy(ndata, data->mv_data, data->mv_size);
|
||||
} else {
|
||||
memcpy(ndata, &ofp->mp_pgno, sizeof(pgno_t));
|
||||
ndata = PAGEDATA(ofp);
|
||||
if (F_ISSET(flags, MDB_RESERVE))
|
||||
data->mv_data = ndata;
|
||||
else
|
||||
else if (ndata != data->mv_data)
|
||||
memcpy(ndata, data->mv_data, data->mv_size);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user