Skip to content

Commit

Permalink
PR: 2009
Browse files Browse the repository at this point in the history
Submitted by: "Alexei Khlebnikov" <alexei.khlebnikov@opera.com>
Approved by: steve@openssl.org

Avoid memory leak and fix error reporting in d2i_SSL_SESSION(). NB: although
the ticket mentions buffer overruns this isn't a security issue because
the SSL_SESSION structure is generated internally and it should never be
possible to supply its contents from an untrusted application (this would
among other things destroy session cache security).
  • Loading branch information
snhenson committed Sep 2, 2009
1 parent f18e102 commit 54ed003
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ssl/ssl_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
}
else
{
SSLerr(SSL_F_D2I_SSL_SESSION,SSL_R_UNKNOWN_SSL_VERSION);
return(NULL);
c.error=SSL_R_UNKNOWN_SSL_VERSION;
goto err;
}

ret->cipher=NULL;
Expand Down Expand Up @@ -505,8 +505,8 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
{
if (os.length > SSL_MAX_SID_CTX_LENGTH)
{
ret->sid_ctx_length=os.length;
SSLerr(SSL_F_D2I_SSL_SESSION,SSL_R_BAD_LENGTH);
c.error=SSL_R_BAD_LENGTH;
goto err;
}
else
{
Expand Down

0 comments on commit 54ed003

Please sign in to comment.