]> Cypherpunks repositories - gostls13.git/commit
internal/poll: avoid overflow in sendfile limit, simplify Solaris
authorDamien Neil <dneil@google.com>
Tue, 29 Oct 2024 18:46:25 +0000 (11:46 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 30 Oct 2024 20:15:22 +0000 (20:15 +0000)
commit4efd5191653293d98ba2a89ea9a5667bbf9abd15
tree7255c6bec4b111c98434bdc41d84731b1ac37400
parent0fd414c652f766e803d7a9b4f70daebd542dd6ab
internal/poll: avoid overflow in sendfile limit, simplify Solaris

Avoid integer overflow when passing a number of bytes to sendfile.

Also, Solaris might not support passing a 0 length to read to
the end of a file, but it does support passing a very large length.
So just do that instead of looking up the source file size.

Change-Id: Ibf750892938d9e2bafb1256c6e380c88899495f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/623315
TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/internal/poll/sendfile_unix.go
src/os/copy_test.go