uutils/coreutils
View on GitHubsort --files0-from Requires UTF-8 / Panics on Non‑UTF‑8 Filenames
Open
#9696 opened on Dec 18, 2025
U - sortgood first issuereported-canonical
Description
Component
sort
Description
When parsing NUL-separated filenames via --files0-from, uutils enforces UTF-8 and uses expect(), which causes an immediate panic when encountering valid non-UTF-8 paths; GNU treats filenames as raw bytes and does not require UTF-8 encoding.
Test / Reproduction Steps
open(b"weird\xffname", "wb").write(b"20\n10\n")
open("list0", "wb").write(b"weird\xffname\0")
$ ./target/release/coreutils sort --files0-from=list0
- GNU: 10 20
- uutils:
thread 'main' (1535230) panicked at src/uu/sort/src/sort.rs:1076:18:
Could not parse string from zero terminated input.: Utf8Error { valid_up_to: 5, error_len: Some(1) }
note: run with
RUST_BACKTRACE=1environment variable to display a backtrac
Impact
This can cause crashes and is incompatible with GNU in terms of "allowing arbitrary byte filenames".