From 43891aba0a42ec85cdcdfeac2a31ffe612eb1841 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Wed, 18 Jan 2023 18:36:27 +0100 Subject: [PATCH] fix(subscriber): fix off-by-one indexing for `callsites` (#391) Co-authored-by: Eliza Weisman --- console-subscriber/src/callsites.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console-subscriber/src/callsites.rs b/console-subscriber/src/callsites.rs index 819f6fc09..feb635638 100644 --- a/console-subscriber/src/callsites.rs +++ b/console-subscriber/src/callsites.rs @@ -23,7 +23,7 @@ impl Callsites { } let idx = self.len.fetch_add(1, Ordering::AcqRel); - if idx <= MAX_CALLSITES { + if idx < MAX_CALLSITES { // If there's still room in the callsites array, stick the address // in there. self.ptrs[idx]