Files
craft-libs/crates/xml/tests
dotCooCoo c995600653 craft-xml: the internal subset search counts what it reads instead of timing
an_internal_subset_is_refused_wherever_it_hides passed its two hostile
inputs (100,000 DOCTYPE markers in one comment, and 100,000 that never
close) only when parsing them finished within 5 s. The test keeps those
parses without the time check. A test-only counter now records each
byte doctype_refused and its helpers read, and each window after()
compares. A new unit test in read.rs,
looking_for_an_internal_subset_is_linear_in_the_input, allows at most
one read per input byte for each input, and the counter fails the test
as soon as the reads pass that limit. With the search resuming one byte
after an unclosed declaration instead of at its end, the test fails at
1,000,005 reads of a 1,000,003-byte input.
2026-11-27 19:06:18 -08:00
..