mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 17:56:50 -06:00
When a PDF, PDF-compatible .ai or .ait opens, crates/pdf/src/file_info.rs reads its File Info from the XMP packet with roxmltree, which parses nested elements recursively and has no limit on their depth. A packet with elements nested 10,000 deep (70 KB) overflowed a 1 MB stack, and one nested 100,000 deep (700 KB) overflowed an 8 MB stack. A stack overflow aborts the app. File Info now counts how deep the packet's elements nest before roxmltree parses it, and leaves out a packet nested more than 256 deep, as it leaves out a packet that is not XML. The document information dictionary then gives the File Info.