]> Cypherpunks.ru repositories - gostls13.git/commit
encoding/gob: use saferio to read large buffer
authorIan Lance Taylor <iant@golang.org>
Sat, 25 Jun 2022 00:00:24 +0000 (17:00 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 19 Aug 2022 16:03:42 +0000 (16:03 +0000)
commitdee9adc0f73d361d00a4d9230bb3517f2448b3b0
treec569f816e05477b18d7b8b31eb5196da8d43e395
parentf324355d1f482362b87ec4f95ceac00d4b4de797
encoding/gob: use saferio to read large buffer

Avoid allocating large amounts of memory for corrupt input.

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

Fixes #53369

Change-Id: I67c5e75bf181ad84988d6d6da12507df0e6df8e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/413979
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/encoding/gob/decode.go
src/encoding/gob/decoder.go
src/go/build/deps_test.go