QR2: Check if session is deleted in sendChallenge
Some checks failed
Build CI / build (push) Has been cancelled

This commit is contained in:
Palapeli 2024-12-27 19:23:02 -05:00
parent 79167423b9
commit 0b10738c16
No known key found for this signature in database
GPG Key ID: 1FFE8F556A474925

View File

@ -33,7 +33,12 @@ func sendChallenge(conn net.PacketConn, addr net.UDPAddr, session Session, looku
challenge = common.RandomString(6) + "00" + hexIP + hexPort
mutex.Lock()
sessions[lookupAddr].Challenge = challenge
if sessionPtr := sessions[lookupAddr]; sessionPtr != nil {
sessionPtr.Challenge = challenge
} else {
mutex.Unlock()
return
}
mutex.Unlock()
}