more doc infrastructure#504
Conversation
…into doc-infrastructure
There was a problem hiding this comment.
💡 Codex Review
OpenDocument.core/src/odr/internal/oldms/text/doc_io.cpp
Lines 133 to 134 in 932c66e
This converts memory allocated by std::make_unique<char[]> into a std::unique_ptr<FibRgFcLcb97>, so when ParsedFib is destroyed after parsing any legacy Word document, the default deleter uses delete on storage that was allocated with new[]. That is undefined behavior and can corrupt the heap during ordinary .doc parsing; the storage needs an owning type/deleter that matches the allocation or a properly constructed struct object.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (files.is_file(AbsPath("/EncryptionInfo")) && | ||
| files.is_file(AbsPath("/EncryptedPackage"))) { | ||
| result.type = FileType::office_open_xml_encrypted; | ||
| result.password_encrypted = true; | ||
| return result; |
There was a problem hiding this comment.
Keep encrypted OOXML out of the legacy handler
When a password-protected .docx/.xlsx/.pptx is a CFB with /EncryptionInfo and /EncryptedPackage, open_strategy tries LegacyMicrosoftFile before OfficeOpenXmlFile; this new branch now succeeds there and returns a LegacyMicrosoftFile, whose decrypt() always throws the legacy unsupported-operation error. Before this change, legacy detection failed and the same file fell through to the OOXML handler that implements decryption, so encrypted OOXML files are no longer decryptable through normal auto-open.
Useful? React with 👍 / 👎.
No description provided.