commit 4ad43d511f6cf064c66eb4bfd0fb0919b5dd8a86
Author: Dr. Stephen Henson <steve@openssl.org>
Date:   Thu May 29 15:00:05 2014 +0100

    Fix CVE-2014-3470
    
    Check session_cert is not NULL before dereferencing it.

Index: openssl-1.0.1e/ssl/s3_clnt.c
===================================================================
--- openssl-1.0.1e.orig/ssl/s3_clnt.c	2014-06-04 18:34:30.298606124 +0000
+++ openssl-1.0.1e/ssl/s3_clnt.c	2014-06-04 18:34:30.318605702 +0000
@@ -2513,6 +2513,13 @@
 			int ecdh_clnt_cert = 0;
 			int field_size = 0;
 
+			if (s->session->sess_cert == NULL) 
+				{
+				ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE);
+				SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE);
+				goto err;
+				}
+
 			/* Did we send out the client's
 			 * ECDH share for use in premaster
 			 * computation as part of client certificate?
