From 85df3dcb7ead5226ec73e62b2dcec1e47b94479b Mon Sep 17 00:00:00 2001 From: Merry Date: Fri, 23 Feb 2018 13:42:47 +0000 Subject: [PATCH] mc: fix invalid range comparison (#37) --- exosphere/mc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exosphere/mc.c b/exosphere/mc.c index fe2233183..6a1d3b358 100644 --- a/exosphere/mc.c +++ b/exosphere/mc.c @@ -4,7 +4,7 @@ #include "mc.h" volatile security_carveout_t *get_carveout_by_id(unsigned int carveout) { - if (CARVEOUT_ID_MIN <= carveout <= CARVEOUT_ID_MAX) { + if (CARVEOUT_ID_MIN <= carveout && carveout <= CARVEOUT_ID_MAX) { return (volatile security_carveout_t *)(MC_BASE + 0xC08ULL + 0x50 * (carveout - CARVEOUT_ID_MIN)); } panic();