diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-09 17:02:44 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-12-10 18:35:18 +0100 |
commit | fed5b5525204a6892c936173d9336c479fa83941 (patch) | |
tree | ee9cc92e7f4f29e5a2cfb6092d73735365084e40 | |
parent | e9e688effbd5f94e9a8614ca0181a9c8a596a6e1 (diff) | |
download | openssl-fed5b5525204a6892c936173d9336c479fa83941.tar.gz |
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>
-rw-r--r-- | ssl/ssl_sess.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 3bac2dbc69..a85f2792ce 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -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'; |