Ver a proveniência

Increment the reference count of sessions inside the lock.

Otherwise another thread may cause the session to be destroyed first.

Change-Id: I2084a28ece11540e1b8f289553161d99395e2d1f
Reviewed-on: https://boringssl-review.googlesource.com/5231
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin há 9 anos
committed by Adam Langley
ascendente
cometimento
bed63548d1
1 ficheiros alterados com 1 adições e 2 eliminações
  1. +1
    -2
      ssl/ssl_sess.c

+ 1
- 2
ssl/ssl_sess.c Ver ficheiro

@@ -420,11 +420,10 @@ int ssl_get_prev_session(SSL *s, const struct ssl_early_callback_ctx *ctx) {

CRYPTO_MUTEX_lock_read(&s->initial_ctx->lock);
ret = lh_SSL_SESSION_retrieve(s->initial_ctx->sessions, &data);
CRYPTO_MUTEX_unlock(&s->initial_ctx->lock);

if (ret != NULL) {
SSL_SESSION_up_ref(ret);
}
CRYPTO_MUTEX_unlock(&s->initial_ctx->lock);
}

if (try_session_cache && ret == NULL &&


Carregando…
Cancelar
Guardar