Skip to content

Commit

Permalink
test(dd): should terminate with error if skip argument is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
ic3man5 authored and sylvestre committed Feb 12, 2025
1 parent 9cf4298 commit 660007a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/by-util/test_dd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1809,3 +1809,13 @@ fn test_wrong_number_err_msg() {
.fails()
.stderr_contains("dd: invalid number: ‘1kBb555’\n");
}

#[test]
fn test_skip_overflow() {
new_ucmd!()
.args(&["bs=1", "skip=9223372036854775808", "count=0"])
.fails()
.stderr_contains(
"dd: invalid number: ‘'9223372036854775808': Value too large for defined data type’",
);
}

0 comments on commit 660007a

Please sign in to comment.