From 61ced962fa7f80e4cf4bb1ec519a605be8672155 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 8 Nov 2026 12:02:51 -0500 Subject: [PATCH] review: charge an exclusion group's copied value against the script allowance --- crates/xfa/src/script.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/xfa/src/script.rs b/crates/xfa/src/script.rs index dd8aced963..52b193bd05 100644 --- a/crates/xfa/src/script.rs +++ b/crates/xfa/src/script.rs @@ -396,11 +396,25 @@ impl Walker<'_> { } children.push(self.field(f, &som, fsibs.at(fi), Some(selected.as_deref().unwrap_or("")))); } + // The group's value is copied into every instance of a repeated subform, so it + // spends the same allowance as the scripts; the selection itself stays as it is + // for the child fields below. + let value = selected.clone().unwrap_or_default(); + let value = match self.script_bytes.checked_add(value.len()).filter(|n| *n <= MAX_EVENT_SCRIPT_BYTES) { + Some(n) => { + self.script_bytes = n; + value + } + None => { + self.truncated = true; + String::new() + } + }; out.push(FormNode { name: g.common.name.clone().unwrap_or_else(|| "group".into()), som: som.clone(), kind: Some(NodeKind::ExclGroup), - value: selected.unwrap_or_default(), + value, presence: self.presence(Some("group"), &som, g.common.presence), access: "open".into(), occur_min: 1,