From 2104d15eb12b03ed4cfa8eb4dc95ad13cee43227 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Wed, 25 Sep 2024 12:44:16 -0400 Subject: Correct an off-by-one error in addr_to_pramin_mut() Not known to cause any current bugs, but could cause the returned address to be inaccessible. --- bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bus.c b/bus.c index f2369eb..cd84232 100644 --- a/bus.c +++ b/bus.c @@ -64,7 +64,7 @@ int addr_to_pramin_mut(struct nvdebug_state *g, goto relocate; } pramin_base = ((uint64_t)window.base) << 16; - if (addr < pramin_base || addr > pramin_base + NV_PRAMIN_LEN) + if (addr < pramin_base || addr >= pramin_base + NV_PRAMIN_LEN) goto relocate; return addr - pramin_base; // Guaranteed to be < 1MiB, so safe for int relocate: -- cgit v1.2.2