Check that handshake.listenEP is non-nil.

In other places in synRcvdState there are also check for listenEP
being non-nil.

PiperOrigin-RevId: 586781261
This commit is contained in:
Konstantin Bogomolov
2023-11-30 14:07:25 -08:00
committed by gVisor bot
parent 6a112c60a2
commit 4733e050eb
+1 -1
View File
@@ -409,7 +409,7 @@ func (h *handshake) synRcvdState(s *segment) tcpip.Error {
// - We receive the ACK based on S.
//
// If we receive a SYN cookie ACK, just use the cookie seqnum.
if !h.checkAck(s) {
if !h.checkAck(s) && h.listenEP != nil {
iss := s.ackNumber - 1
data, ok := h.listenEP.listenCtx.isCookieValid(s.id, iss, s.sequenceNumber-1)
if !ok || int(data) >= len(mssTable) {