]> Cypherpunks repositories - gostls13.git/commit
os: fix regression with handling of nil *File
authorJoe Tsai <joetsai@digital-static.net>
Wed, 8 Jul 2020 05:18:17 +0000 (22:18 -0700)
committerJoe Tsai <joetsai@google.com>
Wed, 8 Jul 2020 18:29:38 +0000 (18:29 +0000)
commit0844ff8eef81e124c1fecba82dd5843745427fa4
treea2a5a02e3265a4b846d61e7c80f711d6a0ca9682
parent4b09c8ad6fb9d30b9c3417b5364809ff0006749d
os: fix regression with handling of nil *File

Use of a nil *File as an argument should not result in a panic,
but result in the ErrInvalid error being returned.
Fix the copy_file_range implementation to preserve this semantic.

Fixes #40115

Change-Id: Iad5ac39664a3efb7964cf55685be636940a8db13
Reviewed-on: https://go-review.googlesource.com/c/go/+/241417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/os/readfrom_linux.go
src/os/readfrom_linux_test.go