Not the memory itself, but the byte after the memory was zeroed.
Этот коммит содержится в:
Ayke van Laethem 2018-08-23 23:44:58 +02:00
родитель e884221fad
коммит 2b78b6d7e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED

Просмотреть файл

@ -43,7 +43,7 @@ func memcpy(dst, src unsafe.Pointer, size uintptr) {
// Set the given number of bytes to zero. // Set the given number of bytes to zero.
func memzero(ptr unsafe.Pointer, size uintptr) { func memzero(ptr unsafe.Pointer, size uintptr) {
for i := uintptr(0); i < size; i++ { for i := uintptr(0); i < size; i++ {
*(*byte)(unsafe.Pointer(uintptr(ptr) + size)) = 0 *(*byte)(unsafe.Pointer(uintptr(ptr) + i)) = 0
} }
} }