Skip to content

Commit

Permalink
QR2: Check if session is deleted in sendChallenge
Browse files Browse the repository at this point in the history
  • Loading branch information
mkwcat committed Dec 28, 2024
1 parent 7916742 commit 0b10738
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion qr2/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 0b10738

Please sign in to comment.