HomeFreeBSD

bin/dd: Fix incorrect casting of arguments

Description

bin/dd: Fix incorrect casting of arguments

dd(1) casts many of its numeric arguments from uintmax_t to intmax_t
and back again to detect whether or not the original arguments were
negative. This caused wrong behaviour in some boundary cases:

$ dd if=/dev/zero of=/dev/null count=18446744073709551615
dd: count cannot be negative

After the fix:

$ dd if=/dev/zero of=/dev/null count=18446744073709551615
dd: count: Result too large

PR: 191263
Submitted by: will@worrbase.com
Approved by: cognet@

Details

Provenance
piAuthored on
Parents
rS273733: Make assignments to "net.inet.tcp.cc.algorithm" work by fixing a bad
Branches
Unknown
Tags
Unknown

Event Timeline