We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e05053 commit 3e7b424Copy full SHA for 3e7b424
1 file changed
src/uu/dd/src/parseargs.rs
@@ -320,8 +320,12 @@ impl Parser {
320
}
321
322
fn parse_bytes(arg: &str, val: &str) -> Result<usize, ParseError> {
323
- parse_bytes_with_opt_multiplier(val)?
324
- .try_into()
+ let num = parse_bytes_with_opt_multiplier(val)?;
+
325
+ if num == 0 {
326
+ return Err(ParseError::InvalidNumber(val.to_string()));
327
+ }
328
+ num.try_into()
329
.map_err(|_| ParseError::BsOutOfRange(arg.to_string()))
330
331
0 commit comments