From: mmiyashita Date: Tue, 21 Jun 2016 18:01:30 +0000 (-0700) Subject: segmentation fault with 'openssl s_client -prexit -keymatexport' X-Git-Tag: OpenSSL_1_1_0-pre6~369 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1d8b4eb2b478651f820423789d7a91b9b4c2d009;p=oweals%2Fopenssl.git segmentation fault with 'openssl s_client -prexit -keymatexport' Reviewed-by: Kurt Roeckx Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1243) --- diff --git a/apps/s_client.c b/apps/s_client.c index 41fed85ea0..56a7081cab 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -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);