HomeFreeBSD

Fix integer overflow detection in dd

Description

Fix integer overflow detection in dd

dd(1) tried to detect whether the seek offset would overflow, but it failed
to account for the case where the provided argument was negative and the
file was a regular file (negative seeks are allowed for character devices).
I fixed it, and added a regression test.

Reported by: Coverity
CID: 1368659
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

Details

Provenance
asomersAuthored on
Parents
rS319338: Implement in_atomic() function in the LinuxKPI.
Branches
Unknown
Tags
Unknown