Skip to content

bug(pr): panics when -o is a large number #12764

@HackingRepo

Description

@HackingRepo

Hi, uutils mainteners

pr panics when the -o option is a large number instead of erroing out like the GNU pr

to reproduce that, i used

relunsec@relunsec:~/software/coreutils/target/debug$ ./pr -o 99999999999
memory allocation of 99999999999 bytes failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted                    (core dumped) ./pr -o 99999999999
relunsec@relunsec:~/software/coreutils/target/debug$ 

then i compared it with GNU pr as i see

relunsec@relunsec:~/software/coreutils/target/debug$ gnupr -o 99999999999
gnupr: '-o MARGIN' invalid line offset: ‘99999999999’: Value too large for defined data type
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