]> Cypherpunks.ru repositories - gostls13.git/commit
debug/buildinfo: check pointer size on buildinfo.Read
authorNikola Jokic <jokicnikola07@gmail.com>
Fri, 2 Dec 2022 16:42:48 +0000 (17:42 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 12 Dec 2022 14:16:49 +0000 (14:16 +0000)
commitc6ad9dc9b523b710afa07d7c5bcb6fe9d21c308c
tree69cae07e17ed3e27feed7a27c6d3dba3111e6fb4
parent5dca7ed66fd7e46ad371dd5c9655077da57eb9cf
debug/buildinfo: check pointer size on buildinfo.Read

Previous implementation has a check on pointer size but only if ptrSize
is 4. but it does not check on ptrSize 8 causing the panic on read for
some inputs.

The explicit check for pointer size 8 is added and error is returned if
ptrSize is not 4 and not 8.

Fixes #57002

Change-Id: Id51de72bdef4da9955d086bfc2a5d735678ee2ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/454616
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/debug/buildinfo/buildinfo.go
src/debug/buildinfo/buildinfo_test.go