fix(xfa): initialize form-data parsing options completely

This commit is contained in:
Mex authored and GitHub committed 2026-11-14 20:18:44 +01:00
1 parent bc505410f8
commit 6bdab5d64c
1 file changed
+2 -2
+2 -2
View File
@@ -192,7 +192,7 @@ pub fn parse_data_file(text: &str, expect_root: Option<&str>) -> Result<Vec<Impo
if crate::xml_nesting_depth(text) > MAX_IMPORT_DEPTH {
return Err(XfaError::TooLarge(format!("the data file nests more than {MAX_IMPORT_DEPTH} levels deep")));
}
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 parsed = crate::xml::Document::parse_with_options(text, opts).map_err(|e| XfaError::Malformed(format!("the data file is not XML: {e}")))?;
let root = parsed.root_element();
let local = root.tag_name().name();
@@ -304,7 +304,7 @@ pub fn export_data(doc: &Document, xdp: bool, pdf_name: &str) -> Result<String,
/// data element), each with the namespaces it uses declared on it. `Ok(None)`: no datasets
/// element; `Err`: the text can't be read.
fn datasets_markup(text: &str) -> Result<Option<(String, String)>, ()> {
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 };
if crate::xml_nesting_depth(text) > crate::MAX_XML_DEPTH {
return Err(());
}