summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_asn1.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-09-02 13:20:02 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-09-02 13:20:02 +0000
commit1da61e8051a67bf449e44a38dd856740caeb0e8b (patch)
treea808ed693da95b8aa9838660c7fa7c4eacb614cd /ssl/ssl_asn1.c
parentda6ce182795432c4ffb658d87ff2de6967b4e5e4 (diff)
PR: 2009
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).
Diffstat (limited to 'ssl/ssl_asn1.c')
-rw-r--r--ssl/ssl_asn1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index 1030260b3b..48b111c8f7 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -353,8 +353,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;
@@ -445,8 +445,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
{