coreutils
coreutils copied to clipboard
tail Obsolete -0 Crashes
Component
tail
Description
uutils accepts obsolete tail -0 FILE (NUM=0) and later hits an internal assertion in the “read backwards” path, causing a panic/crash; GNU treats -0 as “print nothing” and exits normally.
Test / Reproduction Steps
seq 1 10000 > file.txt
./target/release/coreutils tail -0 file.txt
- GNU: prints nothing.
- uutils:
thread 'main' (2925945) panicked at src/uu/tail/src/tail.rs:393:17:
assertion
left == rightfailed left: 1 right: 0 note: run withRUST_BACKTRACE=1environment variable to display a backtrace
Impact
Reliable local DoS (crash) and GNU-incompatible behavior triggered by obsolete -NUM syntax with NUM=0.
Hi, @sylvestre could I be assigned this issue if that's okay? I'll follow the contribution guidelines and reach out in this thread if I have questions.
@dhr412 seems someone got it first :(
it is this pr: https://github.com/uutils/coreutils/pull/10209