mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-09-03 15:47:36 -04:00
Use iOS securePtrOverwriteAndFree implementation for all Apple platforms
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
//go:build ios || darwin
|
||||
|
||||
package main
|
||||
|
||||
// #include <string.h>
|
||||
// #include <stdlib.h>
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
||||
// securePtrOverwriteAndFree securely overwrites the memory at the input pointer and then frees it.
|
||||
func securePtrOverwriteAndFree(input unsafe.Pointer, length C.size_t) {
|
||||
C.memset_s(input, length, 0, length)
|
||||
C.free(input)
|
||||
}
|
||||
Reference in New Issue
Block a user