Repository navigation
Closed
Labels
area:cliWork in the cli area.area:writerWork in the writer area.priority:P2Important quality, usability, or hardening work.type:bugCorrectness defect or regression.
Description
Batch 5's audit of the write path and the CLIs that write files (main at e57db42), each finding confirmed by a second reader unless marked; items 1, 2, 8 and 9 were also re-read by the maintainer session.
rvt-write and writer.rs
--patchesis required even with--dry-run.rvt_write.rs:198unwraps--patchesbefore looking atdry_run, so the manifest-less dry run the flag's help documents (:60-71, "Required unless--dry-runis set") is unreachable.--dry-runexits 0 without checking the streams exist. The help says it exits 0 when "every listed stream exists insrc";:212prints the patches and returns without looking, and without the writer's own refusals (writer.rs:206-217).- The manifest alone picks a stream's on-disk framing (
writer.rs:197,:705), and verification reads back with the same framing, so aFormats/Latestwritten with the wrong framing passes. Fix: check the framing against the stream's convention (writer.rs:144-159documents it) and refuse a mismatch. (medium) - A pad-only base64 value (
"=") decodes to zero bytes and silently empties the stream (rvt_write.rs:137). Fix: refuse an empty decode unless the manifest says so. - An empty
patchesarray writes the copy and then exits 1 with "0 stream(s) failed verification" (writer.rs:613,rvt_write.rs:232-248). --src X --dst Xskips both fast paths and rebuilds the container in place, contradicting the byte-for-byte promise for a patch-free copy (writer.rs:223-224,:280). (The second reader refuted the claim that the source is destroyed:RevitFile::openreads the whole file into memory first,reader.rs:471-473.)- The empty-patch fast path leaves
.<dst>.copy-<pid>behind when the copy or rename fails (writer.rs:294-297), against the module doc (:37-38).
Other CLIs
rvt-info -f csvwrites file text as spreadsheet formulas.csv_field(rvt_info.rs:594-599) quotes commas and quotes but leaves a leading=,+,-or@, so a PartAtom title or user name from a crafted file runs as a formula when the CSV is opened. Fix: prefix such a field with'.rvt-ifc model.rvt -o model.rvtoverwrites the input (rvt_ifc.rs:286-290, sink:348), with no check that the output is not the input.- With
--observation,rvt-ifcskips the atomic.partial+ rename (rvt_ifc.rs:348against:353-366), so a killed export leaves a truncated.ifcunder the final name. rvt-dumpprints stream names as they are (rvt_dump.rs:98-114), so control characters in a crafted name reach the terminal. (The second reader marked this unsure only for what a terminal does with them; the code path is as stated.) Fix: print names withescape_debug, asfile_stem_foralready sanitises them for file names.rvt-dumpkeeps every inflated partition in the reader's memo (rvt_dump.rs:80,reader.rs:965-968) though it needs one at a time, and one stream over the default 256 MiB limit aborts the whole dump with no--max-stream-bytesoption (:59,:72).--extract-previewwrites a file that starts with PNG magic but may lack IEND and calls it a PNG (rvt_info.rs:156-159).gen-fixture --name ../xwrites outsidetests/fixtures(gen_fixture.rs:161-164). Developer tool, the user's own argument; low.
No export moves.
Metadata
Metadata
Assignees
Labels
area:cliWork in the cli area.area:writerWork in the writer area.priority:P2Important quality, usability, or hardening work.type:bugCorrectness defect or regression.
Activity
fix(cli): the CLIs refuse to write over their input under any name, r…
fix(writer): rvt-write --dry-run checks what the write would refuse, …
fix(cli): rvt-dump takes the resource-limit options and goes on past …
DrunkOnJava commentedon Nov 13, 2026
All fourteen items are on main: items 8 to 11 as #1891 (the CLIs refuse to write over their input under any name, CSV cells, control characters in stream names, the atomic observation write), items 1 to 7 as #1893 (
rvt-write --dry-runchecks what the write would refuse, the framing check, the empty base64 and empty patch cases, the file onto itself and the temporary file), and items 12 to 14 as #1906 (rvt-dumptakes the limit options, goes on past a stream over the limit and releases each partition once written;rvt-info --extract-previewrefuses a preview with no IEND chunk;gen-fixturerefuses a name with a path separator). The memoryrvt-dumpsaves by releasing partitions is by construction and was not measured; that is stated in #1906 and its changelog entry.