From 08b028ff0ff867b6d6981056e6aa36ee437d861a Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Tue, 19 Nov 2013 10:42:37 +0100
Subject: [PATCH] Prevent unlikely NULL dereference
---
library/ssl_tls.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index bca55da97..a05b21e3a 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -3583,7 +3583,8 @@ static ssl_key_cert *ssl_add_key_cert( ssl_context *ssl )
if( ssl->key_cert == NULL )
{
ssl->key_cert = key_cert;
- ssl->handshake->key_cert = key_cert;
+ if( ssl->handshake != NULL )
+ ssl->handshake->key_cert = key_cert;
}
else
{