[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7191) libmdb: Alignment of MDB_db members



 On Fri, 2 Mar 2012 08:03:00 GMT, roy.keene@us.army.mil wrote:
> Breaking the assignment into an assignment of its members and using
> the existing COPY_PGNO() alleviates this fault.

 memcpy would be simpler, if it is 'db' which is unaligned.
 Try this instead.

 --- mdb.c~	2012-03-02 11:23:21
 +++ mdb.c	2012-03-02 11:25:06
 @@ -4699,4 +4699,3 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_no
  	if (node->mn_flags & F_SUBDATA) {
 -		MDB_db *db = NODEDATA(node);
 -		mx->mx_db = *db;
 +		memcpy(&mx->mx_db, NODEDATA(node), sizeof(MDB_db));
  		mx->mx_cursor.mc_snum = 0;

-- 
 Hallvard