]> Cypherpunks repositories - gostls13.git/commit
debug/buildinfo: use saferio in ReadData methods
authorIan Lance Taylor <iant@golang.org>
Mon, 6 Mar 2023 19:39:22 +0000 (11:39 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 6 Mar 2023 19:55:57 +0000 (19:55 +0000)
commit4a305be9469f340404f63298fce2575326ceaf99
treeee6b26825eab7d838ae21fc6ec9884fc0afc56cb
parent34d6aaae29023b9edfef2d3360d89e48c8dd118f
debug/buildinfo: use saferio in ReadData methods

This avoids a very large memory allocation if corrupt data says that
we need to read a very long string.

No test case because the problem can only happen for invalid data. Let
the fuzzer find cases like this.

For #47653
Fixes #58886

Change-Id: I4e80ba62a6416d010c8804e4f49ae81bdafaadb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/473657
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/debug/buildinfo/buildinfo.go