]> Cypherpunks repositories - gostls13.git/commit
debug/macho: use saferio to allocate load command slice
authorTobias Klauser <tklauser@distanz.ch>
Thu, 1 Sep 2022 08:48:58 +0000 (10:48 +0200)
committerGopher Robot <gobot@golang.org>
Fri, 2 Sep 2022 17:48:30 +0000 (17:48 +0000)
commit553f02c6ae9d9dc124559b6711a47cb3e99c6348
tree9dec9a69a45a1c9b34cf199c3acf3af032aa3b47
parent6605686e3b503a1d82a526e3970ce4c93f7e2106
debug/macho: use saferio to allocate load command slice

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 #54780

Change-Id: Icdacb16bef7d29ef431da52e6d1da4e883a3e050
Reviewed-on: https://go-review.googlesource.com/c/go/+/427434
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
src/debug/macho/file.go