Skip to content

Commit

Permalink
fix(subscriber): fix off-by-one indexing for callsites (#391)
Browse files Browse the repository at this point in the history
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
danielhenrymantilla and hawkw authored Jan 18, 2023
1 parent a7548d0 commit 3c668a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion console-subscriber/src/callsites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<const MAX_CALLSITES: usize> Callsites<MAX_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]
Expand Down

0 comments on commit 3c668a3

Please sign in to comment.