runtime: don't expose stack buffer in stringto{byte,rune}slice
When using a stack-allocated buffer for the result, don't expose the uninitialized portion of it by restricting its capacity to its length. The other option is to zero the portion between len and cap. That seems like more work, but might be worth it if the caller then appends some stuff to the result. But this close to 1.6, I'm inclined to do the simplest fix possible. Fixes #14232 Change-Id: I21c50d3cda02fd2df4d60ba5e2cfe2efe272f333 Reviewed-on: https://go-review.googlesource.com/19231Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Showing
Please register or sign in to comment