aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/ssl_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/ssl/ssl_asn1.c')
-rw-r--r--crypto/openssl/ssl/ssl_asn1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/openssl/ssl/ssl_asn1.c b/crypto/openssl/ssl/ssl_asn1.c
index 3de1dbc42e79..00f9fda357ae 100644
--- a/crypto/openssl/ssl/ssl_asn1.c
+++ b/crypto/openssl/ssl/ssl_asn1.c
@@ -273,10 +273,11 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
i=SSL2_MAX_SSL_SESSION_ID_LENGTH;
if (os.length > i)
- os.length=i;
+ os.length = i;
+ if (os.length > sizeof ret->session_id) /* can't happen */
+ os.length = sizeof ret->session_id;
ret->session_id_length=os.length;
- die(os.length <= sizeof ret->session_id);
memcpy(ret->session_id,os.data,os.length);
M_ASN1_D2I_get(osp,d2i_ASN1_OCTET_STRING);