[Fixed] The array may be sent out of bounds
This commit is contained in:
parent
a7b3d928f9
commit
c9001cc60c
1 changed files with 3 additions and 1 deletions
|
@ -86,5 +86,7 @@ func (session Session) AllocateSendPacket(packetSize int) (packet []byte, err er
|
|||
}
|
||||
|
||||
func (session Session) SendPacket(packet []byte) {
|
||||
syscall.Syscall(procWintunSendPacket.Addr(), 2, session.handle, uintptr(unsafe.Pointer(&packet[0])), 0)
|
||||
if packet != nil && len(packet) > 0 {
|
||||
syscall.Syscall(procWintunSendPacket.Addr(), 2, session.handle, uintptr(unsafe.Pointer(&packet[0])), 0)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue