Replies: 1 comment
|
这个坑我们手册第 12 章记录过(“Windows 路径 0x00 截断”),根因确认是 临时 workaround(官方修复前):
官方讨论区同根因已有 15+ 帖独立复现(#107 #151 #210 #244 #295 #396 #428 #488 #563 #580 #617 #643 #644 #701 #727 #761 #800),建议合并成一个 issue 追踪。完整排查思路见我们手册: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Version: 0.1.0-rc.6 (also present on
main)Platform: Windows (Win32
IFileOpenDialogpath)Package:
@deepseek-ai/dsh-host-directory-picker-nativeSummary
Opening a directory via the native folder picker fails with:
The real folder name is
07-最終產出, but the path sent toworkspace.createis truncated to07-.Root cause
readUtf16inpackages/host/directory-picker-native/src/win32-dialog-bindings.ts:40scans for the NUL terminator by checking only the low byte of each UTF-16 code unit:A NUL terminator in UTF-16LE is
00 00(both bytes zero), so the loop must check both bytes. Any character whose code point's low byte is0x00is mistaken for the terminator:最= U+6700 → LE bytes00 67→ scan stops → string cut at the preceding character需= U+9700 → LE bytes00 97→ sameU?00, including Latin-1 chars likeĀU+0100,āU+0101…)ASCII is unaffected (each unit is
XX 00, low byte non-zero), which is why English-only paths never hit this. It triggers on the first such character anywhere in the path, at any depth — not on path length.Repro (same scan logic):
Suggested fix
or equivalently check the code unit as a whole:
The existing bound
end + 1 < bytes.lengthalready guaranteesbytes[end + 1]is in range.Notes
dsh-client-ui-directory-picker-browse) is unaffected — it uses the server's listing rows, notreadUtf16.lib/worker.cjsin the published package; both copies share the bug.All reactions