Lichtso / netLink

Socket and Networking Library using msgpack.org[C++11]
GNU General Public License v3.0
216 stars 48 forks source link

MsgPack::storeUint16() - unaligned memory access on ARMv5 #5

Closed clarkli86 closed 9 years ago

clarkli86 commented 9 years ago

In MsgPack::storeUint16(), _reinterpret_cast(target) results in an unaligned memory access on ARMv5 processors. For example when storeUint16() is called to store a length of 0x15 to MAP_16, it is supposed to change header[1] to 0x15 and header[2] to 0x00. However on ARMv5 processors header[0] is also changed to 0x15.

Suggested fix: Replace pointer deference to memcpy()

Lichtso commented 9 years ago

Tanks, I did not think about that. It should be fixed now, but you have to test it.