You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
user-typed PUA codepoints collide with the marker registry: ANSI-C E401 is silently swallowed (data loss); E301/E314 miscount as length 2 #735
A user who types a codepoint that the marker registry also uses has their data silently destroyed or miscounted. This is the concrete payload behind #728: markers.rs carries a user_reachable field whose documented contract is "the entry point producing transport text MUST re-encode that byte (raw-byte marker pair), or the marker silently corrupts data" — and nothing reads that field, so the contract is not enforced anywhere.
Bytes below were captured independently of niu's own od (the probe writes to a file; the bytes are dumped with python from outside), because od on the niu side is itself in the code under test.
$'\uE401' is swallowed entirely. The value is empty, silently, with rc=0 and no diagnostic. U+E401 is a registered marker (ANSI_C_IFS_GUARD), and a user typing that codepoint through ordinary ANSI-C quoting gets nothing back.
${#x} is wrong for PUA codepoints (E301, E314 → 2 instead of 1) even when the stored bytes are byte-identical to GNU. Whatever the length is counting, it is not the string.
Why I would treat (1) as data loss rather than an edge case
$'...' is ordinary documented bash, and \uXXXX is ordinary inside it. A user or a generated script can produce U+E401 without touching anything internal.
The failure is silent: no error, rc=0, empty value. A script that stores such a string then compares or writes it loses the character and cannot tell.
Niubash 1.4.0 (rubash git e785c3c8f610), Windows 10 x64 (build 19045); GNU bash 5.3.0 via WSL; LF script file; stdout and stderr captured to separate files; byte comparisons by python rather than the in-tree od.
Activity
Merge pull request #791 from unixwin/fix/735-pua-marker-collision
merge: resolve markers.rs conflict with #735 (keep both helper sets)
fix(executor): drop the ANSI-C IFS guard before the assignment payloa…
fix(executor): drop the ANSI-C IFS guard before the assignment payloa…
fix(carrier): #728 registry single-declaration-point + #729 byte-clas…