Skip to content

Commit

Permalink
fix nil pointer error
Browse files Browse the repository at this point in the history
When server return a id and client has not set a store, there
will be a nil pointer error.
  • Loading branch information
taoso committed Jun 17, 2021
1 parent 82bf05a commit 94a8dfd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flight3handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ func flight3Parse(ctx context.Context, c flightConn, state *State, cache *handsh
cfg.sessionStore.Del(state.SessionID)
}

state.SessionID = h.SessionID
if cfg.sessionStore == nil {
state.SessionID = []byte{}
} else {
state.SessionID = h.SessionID
}

state.masterSecret = []byte{}
}

Expand Down

0 comments on commit 94a8dfd

Please sign in to comment.