Skip to content

tail Obsolete -0 Crashes #10191

@sylvestre

Description

@sylvestre

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 == right failed
    left: 1
    right: 0
    note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Impact

Reliable local DoS (crash) and GNU-incompatible behavior triggered by obsolete -NUM syntax with NUM=0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions