Skip to content

bug(head): when -n is a massive low negative number panics #12836

@HackingRepo

Description

@HackingRepo

Hi, uutils mainteners

that panic happending only with massive low negative numbers while massive positive numbers no as i confirmed with
the utility head

relunsec@relunsec:~/software/coreutils/target/debug$ ./head -n=-116265256266241262252526 a

thread 'main' (90351) panicked at src/uu/head/src/take.rs:266:73:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
relunsec@relunsec:~/software/coreutils/target/debug$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions