Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle invalid fp->current in SSL hooks, just in case

  • Loading branch information...
commit 8d3be7ed17b46afb9372509d5926ac4358d51ae3 1 parent f837eb2
@gnosek authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 ngx_http_upstream_fair_module.c
View
6 ngx_http_upstream_fair_module.c
@@ -846,6 +846,9 @@ ngx_http_upstream_fair_set_session(ngx_peer_connection_t *pc, void *data)
ngx_ssl_session_t *ssl_session;
ngx_http_upstream_rr_peer_t *peer;
+ if (fp->current == NGX_PEER_INVALID)
+ return NGX_OK;
+
peer = &fp->rrp->peer[fp->current];
/* TODO: threads only mutex */
@@ -872,6 +875,9 @@ ngx_http_upstream_fair_save_session(ngx_peer_connection_t *pc, void *data)
ngx_ssl_session_t *old_ssl_session, *ssl_session;
ngx_http_upstream_rr_peer_t *peer;
+ if (fp->current == NGX_PEER_INVALID)
+ return;
+
ssl_session = ngx_ssl_get_session(pc->connection);
if (ssl_session == NULL) {
Please sign in to comment.
Something went wrong with that request. Please try again.