mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
board: ten64: Fix OOB read in ft_board_setup
base and size arrays can both contain up to total_memory_banks elements. This commit fixes the for loop condition to ensure that it does not attempt to read past the end of both arrays. Signed-off-by: Francois Berder <fberder@outlook.fr> Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
committed by
Peng Fan
parent
408cab5f9d
commit
12cf77821d
@@ -285,7 +285,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
}
|
||||
|
||||
if (mc_memory_base != 0) {
|
||||
for (i = 0; i <= total_memory_banks; i++) {
|
||||
for (i = 0; i < total_memory_banks; i++) {
|
||||
if (base[i] == 0 && size[i] == 0) {
|
||||
base[i] = mc_memory_base;
|
||||
size[i] = mc_memory_size;
|
||||
|
||||
Reference in New Issue
Block a user