mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-29 17:55:45 +01:00
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.