aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandni Cherukuri <chandni.cherukuri@arm.com>2018-12-05 12:34:45 +0530
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-12-11 13:54:43 +0000
commitfdd08233fb104176d3480cdcb23aacb2ec6e2b83 (patch)
treeda67803d136e3b987545147fb58fb92eea52df26
parent652d20a9e6fa0c4ca85bdb7341e98225c28eb61d (diff)
downloadtf-a-tests-fdd08233fb104176d3480cdcb23aacb2ec6e2b83.tar.gz
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>
-rw-r--r--lib/irq/irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irq/irq.c b/lib/irq/irq.c
index 5f2507fdb..c7d671fe7 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];