awnumar/memguard

getBytes improperly uses unsafe to convert a Pointer to a slice

elagergren-spideroak opened this issue · 0 comments

The only valid way of converting an unsafe.Pointer to a slice is with reflect.SliceHeader.

The struct type used inside getBytes is not guaranteed to work across Go versions.

https://github.com/awnumar/memguard/blob/master/core/auxiliary.go#L18-L26