mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-28 12:27:11 -06:00
The app read a file whose name isn't valid Unicode (#1440) with a plain std::fs::read, and file.open on a path (also wordcraft-cli) checked only the length before std::fs::read. Neither checked for a regular file: a named pipe blocked the open (app start-up hung), and /dev/zero read until memory ran out. The new io::read_document reads a document path inside the automation read root, only as a regular file of at most 2 GB, through the existing read_regular_file. open_path_in and the app's open_non_unicode both use it, so the two read a path the same way. Regression tests: file.open on a FIFO and read_document on /dev/zero are refused without blocking (engine), and the app's open of a FIFO or a /dev/zero symlink under a non-Unicode name is a quick warning that leaves the open document alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>