Skip to content

fix(shell): owner 握手超时不再拼接空指针 (#99) - #226

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/owner-ready-failure-ub
Oct 30, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/owner-ready-failure-ub

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

问题

clipboard_scenario_state.hpp 的 ready_failure() 直接把 failure_step_.load() 拼进 std::string:

" failure_step=" + failure_step_.load()

failure_step_ 是 std::atomic<const char*>{nullptr}。当只是 ready 握手超时、没有任何 worker failure 时它仍为 nullptr,std::string + nullptr 是未定义行为(常见结果是崩溃或垃圾字符串)。同一文件的 worker_failure() 对此是有保护的(failed?failed:step_.load()),两处不一致。

修改

ready_failure() 采用与 worker_failure() 相同的回退:无 failure_step 时用当前 state_step。

验证

termforge_shell 构建通过。该分支只在"握手超时且无 worker 失败"时触发,属于低频路径。

背景

由 #99 的证据梳理中发现(该评论同时给出下一步唯一观测建议:失败瞬间 GetOpenClipboardWindow() 的持有者类别)。

Refs #99 #85

…99

A pure handshake timeout leaves failure_step null, so ready_failure now falls back to the current state like worker_failure does instead of concatenating a null pointer.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T03:31:27.650440Z a61b12d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@JavaZeroo
JavaZeroo merged commit 7ff5cde into main Oct 30, 2026
10 checks passed
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