mirror of
https://github.com/rwinkhart/go-boilerplate.git
synced 2026-08-28 04:46:41 -04:00
Avoid compiler optimizations breaking ZeroizeBytes
This commit is contained in:
@@ -2,6 +2,8 @@ package security
|
|||||||
|
|
||||||
// ZeroizeBytes overwrites all
|
// ZeroizeBytes overwrites all
|
||||||
// bytes in a slice with zeros.
|
// bytes in a slice with zeros.
|
||||||
|
//
|
||||||
|
//go:noinline
|
||||||
func ZeroizeBytes(input []byte) {
|
func ZeroizeBytes(input []byte) {
|
||||||
for i := range input {
|
for i := range input {
|
||||||
input[i] = 0
|
input[i] = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user