aboutsummaryrefslogtreecommitdiff
path: root/src/bufio
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2023-02-08 15:06:08 -0500
committerThan McIntosh <thanm@google.com>2023-02-10 18:12:25 +0000
commita7fe9ada10c02a7ea61b2909ef7db151d290073f (patch)
treefde488975994001141d61086f5c2ecaa4cfbd1f6 /src/bufio
parentac8a97ac9e5de94d1c0e830299ce6487cbbfd3f6 (diff)
downloadgo-a7fe9ada10c02a7ea61b2909ef7db151d290073f.tar.xz
cmd/internal/cov: fix misuse of bufio.Reader.Read in read helper
Fix a misuse of bufio.Reader.Read in the helper class cmd/internal/cov.MReader; the MReader method in question should have been using io.ReadFull (passing the bufio.Reader) instead of directly calling Read. Using the Read method instead of io.ReadFull will result in a "short" read when processing a specific subset of counter data files, e.g. those that are short enough to not trigger the mmap-based scheme we use for larger files, but also with a large args section (something large enough to exceed the default 4k buffer size used by bufio.Reader). Along the way, add some additional defered Close() calls for files opened by the CovDataReader.visitPod, to enure we don't leave any open file descriptor following a call to CovDataReader.Visit. Fixes #58411. Change-Id: Iea48dc25c0081be1ade29f3a633df02a681fd941 Reviewed-on: https://go-review.googlesource.com/c/go/+/466677 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/bufio')
0 files changed, 0 insertions, 0 deletions