mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 22:20:27 +00:00
Catch a nil pointer when sending a session packet to a conn, this shouldn't happen but it's caused multiple crashes in conn.recvMsg
This commit is contained in:
parent
c3016e680c
commit
e9bacda0b3
@ -469,7 +469,14 @@ func (sinfo *sessionInfo) _recvPacket(p *wire_trafficPacket) {
|
|||||||
callback := func() {
|
callback := func() {
|
||||||
util.PutBytes(p.Payload)
|
util.PutBytes(p.Payload)
|
||||||
if !isOK || k != sinfo.sharedSesKey || !sinfo._nonceIsOK(&p.Nonce) {
|
if !isOK || k != sinfo.sharedSesKey || !sinfo._nonceIsOK(&p.Nonce) {
|
||||||
// Either we failed to decrypt, or the session was updated, or we received this packet in the mean time
|
// Either we failed to decrypt, or the session was updated, or we
|
||||||
|
// received this packet in the mean time
|
||||||
|
util.PutBytes(bs)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if sinfo.conn == nil {
|
||||||
|
// There's no connection associated with this session for some reason
|
||||||
|
// TODO: Figure out why this happens sometimes, it shouldn't
|
||||||
util.PutBytes(bs)
|
util.PutBytes(bs)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user