From 1d0cbc0a05a3bb5526281bcd58a45a04c827199d Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" <69792125+mayeul-zama@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:31:49 +0100 Subject: [PATCH] fix(strings): fix underflow --- tfhe/src/strings/server_key/pattern/split/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfhe/src/strings/server_key/pattern/split/mod.rs b/tfhe/src/strings/server_key/pattern/split/mod.rs index 5c5cbef221..2dd367f311 100644 --- a/tfhe/src/strings/server_key/pattern/split/mod.rs +++ b/tfhe/src/strings/server_key/pattern/split/mod.rs @@ -427,7 +427,7 @@ impl FheStringIterator for SplitNInternal { // `not_exceeded` false such that next calls are always None match &self.n { UIntArg::Clear(clear_n) => { - if self.counter >= clear_n - 1 { + if self.counter + 1 >= *clear_n { result = state; self.not_exceeded = sk.create_trivial_boolean_block(false); }