mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
4949da46f1
- [CVE-2019-19921](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19921) See https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc10
25 lines
454 B
Go
25 lines
454 B
Go
package internal
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"unsafe"
|
|
)
|
|
|
|
// NativeEndian is set to either binary.BigEndian or binary.LittleEndian,
|
|
// depending on the host's endianness.
|
|
var NativeEndian binary.ByteOrder
|
|
|
|
func init() {
|
|
if isBigEndian() {
|
|
NativeEndian = binary.BigEndian
|
|
} else {
|
|
NativeEndian = binary.LittleEndian
|
|
}
|
|
}
|
|
|
|
func isBigEndian() (ret bool) {
|
|
i := int(0x1)
|
|
bs := (*[int(unsafe.Sizeof(i))]byte)(unsafe.Pointer(&i))
|
|
return bs[0] == 0
|
|
}
|