mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 12:56:00 +01:00
addrmap: Fix off by one in addrmap_set_entry()
The > comparison needs to be changed to >= to prevent an out of bounds write on th next line. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
c594b43022
commit
7dd06b1621
@ -59,7 +59,7 @@ void *addrmap_phys_to_virt(phys_addr_t paddr)
|
|||||||
void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr,
|
void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr,
|
||||||
phys_size_t size, int idx)
|
phys_size_t size, int idx)
|
||||||
{
|
{
|
||||||
if (idx > CONFIG_SYS_NUM_ADDR_MAP)
|
if (idx >= CONFIG_SYS_NUM_ADDR_MAP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
address_map[idx].vaddr = vaddr;
|
address_map[idx].vaddr = vaddr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user