From: Rich Salz Date: Sun, 11 Jun 2017 17:44:56 +0000 (-0400) Subject: If-guard to avoid null ptr deref in statem_srvr.c X-Git-Tag: OpenSSL_1_1_1-pre1~1340 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fbaf2857cc9ea8324b3f19dc79d32a6c1ad31696;p=oweals%2Fopenssl.git If-guard to avoid null ptr deref in statem_srvr.c Reviewed-by: Matt Caswell Reviewed-by: Rich Salz CLA: trivial (Merged from https://github.com/openssl/openssl/pull/3419) --- diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index c26c93bdc9..e2d618c863 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -1444,7 +1444,8 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) err: ossl_statem_set_error(s); - OPENSSL_free(clienthello->pre_proc_exts); + if (clienthello != NULL) + OPENSSL_free(clienthello->pre_proc_exts); OPENSSL_free(clienthello); return MSG_PROCESS_ERROR;