lib/irq: Correct the spi_desc_table array index
The size of the spi_desc_table array is defined as
'PLAT_MAX_SPI_OFFSET_ID - MIN_SPI_ID' which causes
out of bound access for SPI between
'PLAT_MAX_SPI_OFFSET_ID - MIN_SPI_ID' and 'PLAT_MAX_SPI_OFFSET_ID'.
Define the correct size of spi_desc_table array as
'PLAT_MAX_SPI_OFFSET_ID + 1'.
Change-Id: I32cc6fd1d63fa4a2e04387c8ce4b56f472f834ab
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
diff --git a/lib/irq/irq.c b/lib/irq/irq.c
index 5f2507f..c7d671f 100644
--- a/lib/irq/irq.c
+++ b/lib/irq/irq.c
@@ -23,7 +23,7 @@
(((irq_num) >= MIN_SPI_ID) && \
((irq_num) <= MIN_SPI_ID + PLAT_MAX_SPI_OFFSET_ID))
-static spi_desc spi_desc_table[PLAT_MAX_SPI_OFFSET_ID - MIN_SPI_ID];
+static spi_desc spi_desc_table[PLAT_MAX_SPI_OFFSET_ID + 1];
static ppi_desc ppi_desc_table[PLATFORM_CORE_COUNT][
(MAX_PPI_ID + 1) - MIN_PPI_ID];
static sgi_desc sgi_desc_table[PLATFORM_CORE_COUNT][MAX_SGI_ID + 1];