Open xzfc opened 2 years ago
The following snippets crash nsh:
$(printf '\xff')
A=$'\xff' ./target/release/nsh
true $(printf '\x00')
Possible fix to 1 and 2: store strings in Vec<u8>, OsString, or bstr rather than String which forces strings to be valid UTF-8.
Vec<u8>
OsString
bstr
String
Proper behavior for 3 is not specified for POSIX sh; other shells treat it differently.
Good catch and thanks for detailed explanation! I'll work on it when I have time :)
The following snippets crash nsh:
$(printf '\xff')
.A=$'\xff' ./target/release/nsh
.true $(printf '\x00')
.Possible fix to 1 and 2: store strings in
Vec<u8>
,OsString
, orbstr
rather thanString
which forces strings to be valid UTF-8.Proper behavior for 3 is not specified for POSIX sh; other shells treat it differently.