net/netstat: remove a bit more unsafe

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2020-11-17 13:37:39 -08:00 committed by Brad Fitzpatrick
parent c8939ab7c7
commit 5d96ecd5e6

View File

@ -93,7 +93,7 @@ func (t *Table) addEntries(fam int) error {
}
buf = buf[:size]
numEntries := *(*uint32)(unsafe.Pointer(&buf[0]))
numEntries := endian.Native.Uint32(buf[:4])
buf = buf[4:]
var recSize int