Add NULL check in updateSSLPendingFlag#3641
Conversation
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3641 +/- ##
============================================
+ Coverage 76.67% 76.69% +0.01%
============================================
Files 162 162
Lines 80623 80623
============================================
+ Hits 61816 61830 +14
+ Misses 18807 18793 -14
🚀 New features to boost your workflow:
|
murphyjacob4
left a comment
There was a problem hiding this comment.
This guard LGTM and it's good to be defensive here.
But conn->ssl == NULL implies that shutdown or close was previously called. Do we have a bug in the state machine? Ideally after shutdown or close we would move the connection state to reflect that, and fail fast in connTLSRead with the check:
if (conn->c.state != CONN_STATE_CONNECTED) return -1;
I guess we don't move the state machine on shutdown or close in the existing code?
I don't know how it happened, but I know from #3607 that it happened and that this fix prevents the crash. If we can't reproduce it, we can only try to follow all call sites to see how this can happen. Let's backport this small fix and then we can improve the state machine in future versions? |
Fixes valkey-io#3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes valkey-io#3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes valkey-io#3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes valkey-io#3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607 Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Fixes #3607