Skip to content

fix: audit quick fixes (silent wrong output) - #151

Open
Chimi6 wants to merge 13 commits into
mainfrom
quick-fixes
Open

Chimi6 wants to merge 13 commits into
mainfrom
quick-fixes

Conversation

@Chimi6

@Chimi6 Chimi6 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Small silent-wrong-output fixes from the November 2026 audit. Each has a regression test in tests/quick_fixes.rs (fixtures in tests/fixtures/audit/) unless noted.

Audit id Fix Test
5 C1 bare email after non-ASCII text no longer panics (mailto: compared as bytes) bare_email_after_non_ascii_does_not_panic
2b HTML comment end was three bytes short, --> leaked html_comment_does_not_leak
2b H2 nested table text flows into the outer cell (Markdown, HTML, text) nested_table_text_flows_into_the_outer_cell
2b H3 w:sym maps Symbol and Wingdings codes to Unicode word_symbol_characters_follow_their_font
2c C1 ODS number under the Text format reads as its value ods_number_in_text_format_cell_keeps_its_value
3b H1 xlsx to ods keeps string cells as strings (reader reports which cells are text) xlsx_text_cells_stay_text_in_ods
2c H1 JSON/YAML/TOML to XML: array root member wrapped in one <root> with the warning xml_root_member_that_is_an_array_is_wrapped_in_one_root
2c H2 XLSX writes _xHHHH_; XML escape helpers drop characters XML 1.0 cannot carry and the planner reports one loss per step control_characters_*
2c M5 XLSX reader decodes _xHHHH_ xlsx_midnight_rounding_durations_and_escapes
2c H3, H4, H5 midnight rounding carries into the day; [h]:mm:ss reads as 30:05:00 (and stays a duration in ODS); prefixed worksheet elements read xlsx_midnight_*, xlsx_durations_survive_to_ods, xlsx_prefixed_worksheet_reads
2c H6 blank/duplicate CSV header cells get column_N / name_2 keys with a loss event csv_header_keys_are_made_unique_with_a_loss
2d H1, 3b M2 BMP V4/V5 BI_RGB ignores header masks; 16-bit alpha masks kept bmp_*
3a F1 EUC-KR/GBK no longer read as EUC-JP: legacy text must carry kana korean_and_chinese_legacy_text_is_not_misread_as_japanese, japanese_legacy_text_still_reads, cjk unit tests
3a F2 ISO-2022-JP found by escapes in valid UTF-8 for text, Markdown, HTML, CSV iso_2022_jp_reads_in_text_markdown_html_and_csv

Docs updated: DOCS/LANGUAGES.md, formats xml, csv, bmp, xlsx, ods, docx; CHANGELOG; STATE Tech Debt.

Behaviour changes worth knowing:

  • Japanese written entirely in kanji (no kana) in a legacy encoding is now refused, as Chinese is (it is indistinguishable). Recorded in Tech Debt.
  • A CSV/Numbers table with a blank header cell now exits 2 (loss) and names the key column_N; tests/cli.rs and tests/numbers.rs were updated for that.
  • Dropping XML-invalid characters applies to every writer using the shared escape helpers (DOCX, ODT, EPUB too).

Checks: cargo fmt --check clean, cargo clippy --all-targets -- -D warnings clean, cargo test --all-targets 693 passed 0 failed, check-formats-doc.sh and check-deps.sh pass, cargo doc ok. Release binary 4,671,856 bytes on this Mac (budget 5,780,000 is the Linux figure; CI will measure that). Wasm job not run locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant