Skip to content

enforce StreamReadConstraints.maxNestingDepth in FromXmlParser - #891

Open
Sahana2524 wants to merge 1 commit into
FasterXML:3.xfrom
Sahana2524:xml-read-nesting-depth
Open

enforce StreamReadConstraints.maxNestingDepth in FromXmlParser#891
Sahana2524 wants to merge 1 commit into
FasterXML:3.xfrom
Sahana2524:xml-read-nesting-depth

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

FromXmlParser increments read-context nesting depth on each child Object/Array, but never validates it, so a configured StreamReadConstraints.maxNestingDepth is ignored when reading XML.

  • ToXmlGenerator already validates StreamWriteConstraints.maxNestingDepth on the write side, and jackson-core JsonParserBase does the same on read, so the XML read path was the outlier
  • the default limit (500) sits below Woodstox element-depth default (1000), so three existing deep-nesting tests reached the jackson-core limit first; I raised their maxNestingDepth so each still exercises the limit it was written for (Woodstox element depth, token count)

New test covers rejection past a low configured limit while staying within the Stax element-depth limit.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 73.70% 📉 -0.010%
Branches branches 68.56% 📈 +0.000%

Coverage data generated from JaCoCo test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant