From 574566550941aec56611f79d589bb4200b4b5b48 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 10 May 2012 18:04:27 -0500 Subject: gem5: assert before indexing intro arrays to verify bounds --- src/dev/arm/gic.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/dev') diff --git a/src/dev/arm/gic.cc b/src/dev/arm/gic.cc index f686c2a13..94719f86f 100644 --- a/src/dev/arm/gic.cc +++ b/src/dev/arm/gic.cc @@ -193,10 +193,12 @@ Gic::readDistributor(PacketPtr pkt) pkt->set(int_p[int_num]); break; case 2: + assert((int_num + 1) < (SGI_MAX + PPI_MAX)); pkt->set(int_p[int_num] | int_p[int_num+1] << 8); break; case 4: + assert((int_num + 3) < (SGI_MAX + PPI_MAX)); pkt->set(int_p[int_num] | int_p[int_num+1] << 8 | int_p[int_num+2] << 16 | -- cgit v1.2.3