From 407dea0298112d37f95bcf2b678d0e5430205d01 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Tue, 2 Feb 2021 19:15:47 +1300 Subject: [PATCH] There was an off-by-one error on boundscheck. --- src/Services/Prosody/slice.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Prosody/slice.vala b/src/Services/Prosody/slice.vala index 0462813..92059ab 100644 --- a/src/Services/Prosody/slice.vala +++ b/src/Services/Prosody/slice.vala @@ -26,7 +26,7 @@ public class Slice : Gee.Hashable, Object { public int length {get {return _.length;}} public new uint8 get(int i) { - if (i > length) return 0; + if (i >= length) return 0; return _[i < 0 ? length + i : i]; } public Slice slice(int start_, int end_) {