mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-04-05 00:35:26 -05:00
Add length check to natneg handleReport
This commit is contained in:
parent
3029af0ecb
commit
f5ffcbccec
|
|
@ -9,7 +9,12 @@ import (
|
|||
"github.com/logrusorgru/aurora/v3"
|
||||
)
|
||||
|
||||
func (session *NATNEGSession) handleReport(conn net.PacketConn, addr net.Addr, buffer []byte, _ string, version byte) {
|
||||
func (session *NATNEGSession) handleReport(conn net.PacketConn, addr net.Addr, buffer []byte, _moduleName string, version byte) {
|
||||
if len(buffer) < 2 {
|
||||
logging.Error(_moduleName, "Invalid packet size")
|
||||
return
|
||||
}
|
||||
|
||||
response := createPacketHeader(version, NNReportReply, session.Cookie)
|
||||
response = append(response, buffer[:9]...)
|
||||
response[14] = 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user