Skip to content

Commit

Permalink
Fix register_match_var out of bounds error (closes stalwartlabs/mail-…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Nov 22, 2024
1 parent dffc4b7 commit 0e24d13
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
sieve-rs 0.5.3
================================
- Fixed `register_match_var` function.

sieve-rs 0.5.2
================================
- Fixed `set_global_variable` function.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "AGPL-3.0-only"
keywords = ["sieve", "interpreter", "compiler", "email", "mail"]
categories = ["email", "compilers"]
readme = "README.md"
version = "0.5.2"
version = "0.5.3"
edition = "2021"

[lib]
Expand All @@ -21,7 +21,7 @@ phf = { version = "0.11", features = ["macros"] }
serde = { version = "1.0", features = ["derive", "rc"] }
bincode = "1.3.3"
ahash = { version = "0.8.0" }
fancy-regex = "0.13.0"
fancy-regex = "0.14.0"

[dev-dependencies]
serde_json = "1.0"
Expand Down
1 change: 1 addition & 0 deletions src/compiler/grammar/actions/action_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use crate::{
};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[allow(clippy::large_enum_variant)]
pub(crate) enum Modifier {
Lower,
Upper,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/grammar/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ impl<'x> CompilerState<'x> {
debug_assert!(num < 63);

for pos in &block.match_test_pos {
if let Instruction::Test(test) = &mut self.instructions[*pos] {
if let Some(Instruction::Test(test)) = self.instructions.get_mut(*pos) {
let match_type = match test {
Test::Address(t) => &mut t.match_type,
Test::Body(t) => &mut t.match_type,
Expand Down

0 comments on commit 0e24d13

Please sign in to comment.