arm: Fix heap overflow issue in Neon64Load operation

This patch fixes an issue identified by ASAN where the Neon64Load
operation assumes the packet always contains 16 bytes.

Change-Id: If24a7e461d60cb80970dfbe61d923d7d56926698
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
This commit is contained in:
Andreas Hansson 2016-05-26 11:56:24 +01:00
parent 4a3e2156ac
commit 7dc5034ff2

View file

@ -332,7 +332,8 @@ def template NeonLoadCompleteAcc64 {{
%(op_decl)s;
%(op_rd)s;
MemUnion &memUnion = *(MemUnion *)pkt->getPtr<uint8_t>();
MemUnion memUnion { { } };
memcpy(&memUnion, pkt->getPtr<uint8_t>(), pkt->getSize());
if (fault == NoFault) {
%(memacc_code)s;