hostname: hostname doesn't accept invalid utf-8
Open
Nobody has claimed this yet.
U - hostname
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
$ sudo cargo run -p uu_hostname $'\xFF'
thread 'main' (40469) panicked at library/std/src/env.rs:871:51:
called `Result::unwrap()` on an `Err` value: "\xFF"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running sudo cargo run -p uu_hostname $'\xFF' and inspect the uu_hostname package entry point around how the hostname argument is read. Done means the shown invalid UTF-8 input no longer causes the command to panic; add or run a regression test for that behavior if the package's existing tests provide a suitable location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100