[Fixed] The array may be sent out of bounds
This commit is contained in:
parent
7d17d53a8f
commit
e92ef587bb
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) {
|
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