From: Jakub Zelenka Date: Tue, 28 Apr 2026 20:43:45 +0000 (+0200) Subject: Check wrlmethod existence before sending alert X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3fc4ad5aab59ed525245ec704af3b04effc05eb;p=thirdparty%2Fopenssl.git Check wrlmethod existence before sending alert 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 Reviewed-by: Eugene Syromiatnikov Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell MergeDate: Fri May 1 12:09:11 2026 (Merged from https://github.com/openssl/openssl/pull/31017) --- diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c index a36f2019894..04887bc9d1e 100644 --- a/ssl/statem/statem.c +++ b/ssl/statem/statem.c @@ -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); }