Fix bug in runtime.memzero

Not the memory itself, but the byte after the memory was zeroed.
This commit is contained in:
Ayke van Laethem
2018-08-23 23:44:58 +02:00
parent e884221fad
commit 2b78b6d7e8
+1 -1
View File
@@ -43,7 +43,7 @@ func memcpy(dst, src unsafe.Pointer, size uintptr) {
// Set the given number of bytes to zero.
func memzero(ptr unsafe.Pointer, size uintptr) {
for i := uintptr(0); i < size; i++ {
*(*byte)(unsafe.Pointer(uintptr(ptr) + size)) = 0
*(*byte)(unsafe.Pointer(uintptr(ptr) + i)) = 0
}
}