Skip to content

Conversation

@mfontanaar
Copy link

Fixes #7216

cargo run dd bs=1 skip=9223372036854775808 count=0
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/coreutils dd bs=1 skip=9223372036854775808 count=0`
dd: invalid number: ‘'9223372036854775808': Value too large for defined data type’

Original PR: #7275

BsOutOfRange(String),
#[error("{}", translate!("dd-error-invalid-number", "input" => .0.clone()))]
InvalidNumber(String),
#[error("invalid number: ‘{0}’: {1}")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the translate macro here

if skip > i64::MAX as u64 {
return Err(ParseError::InvalidNumberWithErrMsg(
format!("{skip}"),
"Value too large for defined data type".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dd: should terminate with error if skip argument is too large

3 participants