SSL_set_session: check for NULL after allocating s->kssl_ctx->client_princ
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
e9e688effb
commit
fed5b55252
1 changed files with 5 additions and 0 deletions
|
@ -792,6 +792,11 @@ int SSL_set_session(SSL *s, SSL_SESSION *session)
|
|||
session->krb5_client_princ_len > 0)
|
||||
{
|
||||
s->kssl_ctx->client_princ = (char *)OPENSSL_malloc(session->krb5_client_princ_len + 1);
|
||||
if (s->kssl_ctx->client_princ == NULL)
|
||||
{
|
||||
SSLerr(SSL_F_SSL_SET_SESSION, ERR_R_MALLOC_FAILURE);
|
||||
return(0);
|
||||
}
|
||||
memcpy(s->kssl_ctx->client_princ,session->krb5_client_princ,
|
||||
session->krb5_client_princ_len);
|
||||
s->kssl_ctx->client_princ[session->krb5_client_princ_len] = '\0';
|
||||
|
|
Loading…
Reference in a new issue