mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 18:56:55 -06:00
The shared PDF reader (craft_pdf::syntax, craft-libs ca50d63b) indexes a dictionary by skipping its values. Its skip accepts some values that its parse refuses, such as a name with a broken # escape (/#zz) and a number such as 12-.5. Dict::entries unwraps the parse of each value (vendor/hayro-syntax/src/object/dict.rs:104). The check in pages.rs that refuses functions and color spaces built on one another without end (nests_without_end) calls entries on every dictionary of a file when the file opens. So document.pdfInfo, PDF import, clipboard.importPdf and loading a .ai panicked on such a file, and three import fuzz tests fail on main with PROPTEST_RNG_SEED=1182 and PROPTEST_CASES=20000. The check now reads a dictionary's values with keys and get_raw and leaves out a value that doesn't parse. A test in crates/pdf puts each of those values in a file with a plain function, which opens, and in a file with a function that stitches itself, which is still refused.