fix(xfa): initialize merged-packet parsing options completely

This commit is contained in:
Mex authored and GitHub committed 2026-11-14 20:18:51 +01:00
1 parent 6bdab5d64c
commit b429031b7e
1 file changed
+2 -2
+2 -2
View File
@@ -117,7 +117,7 @@ fn merge(text: &str, within: Within, op: Op, warnings: &mut Vec<String>) -> Merg
warnings.push("The XFA data nests XML elements deeper than the reader accepts; the field values were not written to it".into());
return Merged::Failed;
}
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES, ..Default::default() };
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES };
// A packet of an array may use the prefixes the XDP envelope declares: read it inside
// an element declaring the usual ones.
let wrapped;
@@ -465,7 +465,7 @@ pub(super) fn readable(text: &str, within: Within, warnings: &mut Vec<String>) -
warnings.push(format!("The XFA data would be larger than {} MB; it was not written", MAX_PACKET_WRITE >> 20));
return false;
}
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES, ..Default::default() };
let opts = || crate::xml::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES };
let ok = crate::xml::Document::parse_with_options(text, opts()).is_ok()
|| (within == Within::Packet && crate::xml::Document::parse_with_options(&format!("{WRAP_OPEN}{text}{WRAP_CLOSE}"), opts()).is_ok());
if !ok {