mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-29 20:47:32 -06:00
Two crashes that a PDF can trigger, each with a regression test that failed before this change: - Deeply nested arguments in a field's format script (`[[[[…` or `new Array(new Array(…`) and deeply nested simplified field notation (`((((…` or `----…1`) recursed until the stack overflowed, which aborts the whole app. Nesting is now capped at 64 levels; deeper input is rejected like any other unparseable script. - A date with a huge year (`1/1/2147483647`) overflowed `weekday`, and a `DateTime` with month 0 indexed before the month names. The weekday math is now done in i64, years beyond i32 don't parse, and month and day names are looked up with `get`. Also removes the crate's remaining `expect`/`unreachable!` calls and denies the panic lints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>