]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Check wrlmethod existence before sending alert
authorJakub Zelenka <jakub.zelenka@openssl.foundation>
Tue, 28 Apr 2026 20:43:45 +0000 (22:43 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 1 May 2026 12:09:03 +0000 (08:09 -0400)
If there is a memory failure during record wrlmethod allocation, then
the alert is attemted but it crashes because wrlmethod is NULL.

Found using memfail integration to fuzz tests: GH-30944

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Fri May  1 12:09:11 2026
(Merged from https://github.com/openssl/openssl/pull/31017)

ssl/statem/statem.c

index a36f2019894fad0c43eeee698c752256c3aa431f..04887bc9d1e28bee5fe9cbb296d8c6724ee2797c 100644 (file)
@@ -152,7 +152,7 @@ void ossl_statem_send_fatal(SSL_CONNECTION *s, int al)
         return;
     ossl_statem_set_in_init(s, 1);
     s->statem.state = MSG_FLOW_ERROR;
-    if (al != SSL_AD_NO_ALERT)
+    if (al != SSL_AD_NO_ALERT && s->rlayer.wrlmethod != NULL)
         ssl3_send_alert(s, SSL3_AL_FATAL, al);
 }