fix(store): correct unsafe bytes to string conversion in store/internal/conv (#25130)

This commit is contained in:
James Niken 2025-08-11 15:21:05 +02:00 committed by GitHub
parent 28b9b99f57
commit 2f32bdf37f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,5 +15,5 @@ func UnsafeStrToBytes(s string) []byte {
// to be used generally, but for a specific pattern to delete keys
// from a map.
func UnsafeBytesToStr(b []byte) string {
return *(*string)(unsafe.Pointer(&b))
return unsafe.String(unsafe.SliceData(b), len(b))
}