]> Cypherpunks.ru repositories - gostls13.git/commit
debug/elf: use saferio.SliceCap when decoding ELF sections
authorZeke Lu <lvzecai@gmail.com>
Mon, 24 Oct 2022 23:37:05 +0000 (23:37 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 25 Oct 2022 16:51:48 +0000 (16:51 +0000)
commit2bdb5c57f1efcbddab536028d053798e35de6226
tree24476664d5a84e7e1bed00b5ab81e0c3cf53dc37
parent90a67d052e6dc3f9d522820ca60cc9862a8016ba
debug/elf: use saferio.SliceCap when decoding ELF sections

This avoids allocating an overly large slice for corrupt input.

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

Updates #33121.

Change-Id: Ie2d947a3865d3499034286f2d08d3e3204015f3e
GitHub-Last-Rev: 6c62fc3cec1c6343c76f22f6a2a4ddae060fa2f4
GitHub-Pull-Request: golang/go#56405
Reviewed-on: https://go-review.googlesource.com/c/go/+/445076
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/debug/elf/file.go