segmentation fault with 'openssl s_client -prexit -keymatexport'
authormmiyashita <mmiyashita@users.noreply.github.com>
Tue, 21 Jun 2016 18:01:30 +0000 (11:01 -0700)
committerRich Salz <rsalz@openssl.org>
Tue, 21 Jun 2016 21:30:46 +0000 (17:30 -0400)
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1243)

apps/s_client.c

index 41fed85ea0ff3e77e703c7020b8797ea75bb1a1d..56a7081cab8f2b6f69a35c72713155a99c6448f1 100644 (file)
@@ -2633,7 +2633,8 @@ static void print_stuff(BIO *bio, SSL *s, int full)
 #endif
 
     SSL_SESSION_print(bio, SSL_get_session(s));
-    if (keymatexportlabel != NULL) {
+    if ((SSL_get_session(s) != NULL) &&
+        (keymatexportlabel != NULL)) {
         BIO_printf(bio, "Keying material exporter:\n");
         BIO_printf(bio, "    Label: '%s'\n", keymatexportlabel);
         BIO_printf(bio, "    Length: %i bytes\n", keymatexportlen);