Skip to content

Commit

Permalink
Avoid questionable use of the value of a pointer
Browse files Browse the repository at this point in the history
that refers to space
deallocated by a call to the free function in tls_decrypt_ticket.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #2897)
(cherry picked from commit 13ed1af)
  • Loading branch information
bernd-edlinger authored and Rich Salz committed Mar 10, 2017
1 parent acdf081 commit 5e90cb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ssl/t1_lib.c
Expand Up @@ -3577,10 +3577,11 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
p = sdec;

sess = d2i_SSL_SESSION(NULL, &p, slen);
slen -= p - sdec;
OPENSSL_free(sdec);
if (sess) {
/* Some additional consistency checks */
if (p != sdec + slen || sess->session_id_length != 0) {
if (slen != 0 || sess->session_id_length != 0) {
SSL_SESSION_free(sess);
return 2;
}
Expand Down

0 comments on commit 5e90cb5

Please sign in to comment.