git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c594b43
)
addrmap: Fix off by one in addrmap_set_entry()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Tue, 25 Jul 2023 06:50:40 +0000
(09:50 +0300)
committer
Tom Rini
<trini@konsulko.com>
Mon, 30 Oct 2023 19:32:49 +0000
(15:32 -0400)
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>
lib/addr_map.c
patch
|
blob
|
history
diff --git
a/lib/addr_map.c
b/lib/addr_map.c
index
9b3e0a5
..
86e932e
100644
(file)
--- a/
lib/addr_map.c
+++ b/
lib/addr_map.c
@@
-59,7
+59,7
@@
void *addrmap_phys_to_virt(phys_addr_t paddr)
void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr,
phys_size_t size, int idx)
{
- if (idx > CONFIG_SYS_NUM_ADDR_MAP)
+ if (idx >
=
CONFIG_SYS_NUM_ADDR_MAP)
return;
address_map[idx].vaddr = vaddr;