]> Cypherpunks repositories - gostls13.git/commit
reflect: fix pointer past-the-end in Call with zero-sized return value
authorCherry Zhang <cherryyz@google.com>
Fri, 1 Sep 2017 02:02:37 +0000 (22:02 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 19 Sep 2017 20:45:24 +0000 (20:45 +0000)
commit0a48185b4383fac8d260112efa261112f3d41ee2
tree0f291f535514d47f5b22fc3a5a43590563860cdc
parentd1731f8cbc1adde72a2b2e7513b6ca73476c7f0d
reflect: fix pointer past-the-end in Call with zero-sized return value

If a function with nonzero frame but zero-sized return value is
Call'd, we may write a past-the-end pointer in preparing the
return Values. Fix by return the zero value for zero-sized
return value.

Fixes #21717.

Change-Id: I5351cd86d898467170a888b4c3fc9392f0e7aa3b
Reviewed-on: https://go-review.googlesource.com/60811
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/reflect/all_test.go
src/reflect/value.go