mirror of
https://github.com/rwinkhart/go-boilerplate.git
synced 2026-10-26 21:39:56 -04:00
Avoid compiler optimizations breaking ZeroizeBytes
This commit is contained in:
1 parent
29315c4b76
commit
26686374bd
1 file changed
+2
@@ -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