Repository navigation
Conversation
1. Root cause: ~EditWrapper() destructor deleted m_pTextEdit before m_pWaringNotices, leaving DMessageManager with a dangling pointer to the already-freed m_pTextEdit (use-after-free, CWE-416) 2. Fix: move m_pWaringNotices cleanup before m_pTextEdit deletion so DMessageManager processes message removal while m_pTextEdit is still valid; also un-comment and restore the previously disabled m_pWaringNotices cleanup block (was commented out for bug 78042) 3. Impact: destructor cleanup order change only; no behavior change for normal edit/close workflows Log: Fix crash when closing text editor after editing a file in a zip archive Influence: 1. Test opening a text file from a zip archive, editing and saving, then closing the tab - verify no crash 2. Test file reload notification dialog appears and dismisses correctly 3. Verify normal file open/edit/close workflow has no regression fix: 修复压缩包中编辑文本文档关闭后崩溃问题 1. 根因:~EditWrapper() 析构函数中 m_pTextEdit 的 delete 早于 m_pWaringNotices,导致 DMessageManager 持有已释放的 m_pTextEdit 悬空指针,触发 use-after-free 崩溃(CWE-416) 2. 方案:将 m_pWaringNotices 的清理移至 m_pTextEdit 删除之前,使 DMessageManager 处理消息移除时 m_pTextEdit 仍然有效;同时恢复 此前因 bug 78042 被注释掉的 m_pWaringNotices 清理代码块 3. 影响:仅调整析构函数清理顺序,对正常编辑/关闭流程无行为变化 Log: 修复压缩包中打开文本文档编辑保存后关闭时文本编辑器崩溃的问题 Influence: 1. 测试从 zip 压缩包中打开文本文档,编辑保存后关闭标签页,验证不崩溃 2. 测试文件变更重载提示弹框正常显示和关闭 3. 验证正常文件打开/编辑/关闭流程无回归 PMS: BUG-378881
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe destructor now cleans up m_pWaringNotices before m_pTextEdit, eliminating the close-time use-after-free reported when editing files inside ZIP archives while preserving normal edit and close behavior. Sequence diagram for safe EditWrapper destructionsequenceDiagram
participant EditWrapper
participant DMessageManager
participant WarningNotices
participant TextEdit
EditWrapper->>WarningNotices: disconnect(WarningNotices)
EditWrapper->>WarningNotices: delete WarningNotices
WarningNotices->>DMessageManager: remove messages while TextEdit is valid
EditWrapper->>TextEdit: disconnect(TextEdit)
EditWrapper->>TextEdit: delete TextEdit
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto reviewAI 代码审查报告
总体评价总分: 100分 代码审查通过。本次提交修复了在 zip 归档中编辑文本后关闭时的崩溃问题(bug 378881/78042),通过调整析构函数中 四维度评分
漏洞统计
漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 详细分析维度1:语法逻辑(25分)✓评价: 语法正确,逻辑清晰 分析内容: 修改文件: 本次修改在析构函数中新增了
该清理模式与同文件中 空指针检查( 无语法错误,无逻辑缺陷,边界处理完善。 维度2:代码质量(25分)✓评价: 代码结构清晰,注释完整 分析内容:
无重复代码,可读性好,符合编码规范。 维度3:代码性能(20分)✓评价: 性能良好,资源使用合理 分析内容:
无性能问题,算法复杂度合理,资源使用合理。 维度4:代码安全(30分)✓存在0个安全漏洞 评价: 安全合规 分析内容: 本次修改实际上修复了一个内存安全漏洞(use-after-free):
无新增安全漏洞,无硬编码密钥,无敏感信息泄露,无注入风险。 修改文件清单
改进建议本次代码修改质量优秀,无需额外改进。以下为可选的后续优化建议:
审查结论本次提交是一个高质量的 Bug 修复,精准地解决了 use-after-free 崩溃问题。代码修改与 commit message 描述的目的一致,注释详尽,逻辑清晰,无安全漏洞。建议合并。 |
fix: fix crash on close after editing text in zip archive
m_pWaringNotices, leaving DMessageManager with a dangling pointer
to the already-freed m_pTextEdit (use-after-free, CWE-416)
DMessageManager processes message removal while m_pTextEdit is
still valid; also un-comment and restore the previously disabled
m_pWaringNotices cleanup block (was commented out for bug 78042)
for normal edit/close workflows
Log: Fix crash when closing text editor after editing a file in a zip archive
Influence:
then closing the tab - verify no crash
fix: 修复压缩包中编辑文本文档关闭后崩溃问题
m_pWaringNotices,导致 DMessageManager 持有已释放的 m_pTextEdit
悬空指针,触发 use-after-free 崩溃(CWE-416)
DMessageManager 处理消息移除时 m_pTextEdit 仍然有效;同时恢复
此前因 bug 78042 被注释掉的 m_pWaringNotices 清理代码块
Log: 修复压缩包中打开文本文档编辑保存后关闭时文本编辑器崩溃的问题
Influence:
PMS: BUG-378881
Summary by Sourcery
Bug Fixes: