Skip to content

Commit 55f32a6

Browse files
Guillermo Alejandro Gallardo DiezGuillermo Alejandro Gallardo Diez
authored andcommitted
chore: use constant as max size for regex
1 parent 7eeaa20 commit 55f32a6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

crates/ironclaw_engine/src/runtime/mission.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type EventRegexCache = HashMap<MissionId, regex::Regex>;
4040
/// Maximum compiled regex size, mirroring the v1 routine engine. Patterns
4141
/// that exceed this are refused at compile time so a hostile or buggy
4242
/// mission cannot pin the matcher with a pathological regex.
43-
const MAX_EVENT_REGEX_SIZE: usize = 64 * 1024;
43+
pub const MAX_EVENT_REGEX_SIZE: usize = 64 * 1024;
4444

4545
/// Per-user fire-rate ceiling expressed as a token bucket. Independent of
4646
/// per-mission `cooldown_secs`, this is a *global* cap across all of a

src/bridge/effect_adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ fn parse_cadence(
11661166
};
11671167
// Validate with the same size limit the engine uses at runtime.
11681168
if let Err(e) = regex::RegexBuilder::new(pattern)
1169-
.size_limit(64 * 1024)
1169+
.size_limit(ironclaw_engine::runtime::mission::MAX_EVENT_REGEX_SIZE)
11701170
.build()
11711171
{
11721172
return Err(format!(

0 commit comments

Comments
 (0)