Do not call SSLfatal with s that can potentially be NULL.
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=
1681455
Fixes: 6c3edd4f3a8a "Add server-side handling of Encrypted Client Hello"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Feb 25 11:10:47 2026
(Merged from https://github.com/openssl/openssl/pull/30139)
const unsigned char *ch = NULL;
size_t ch_len = 0, exts_len = 0, sni_len = 0, ech_len = 0;
- if (s == NULL || pkt == NULL || sessid_off == NULL || exts_off == NULL
+ if (s == NULL)
+ return 0;
+ if (pkt == NULL || sessid_off == NULL || exts_off == NULL
|| ech_off == NULL || echtype == NULL || inner == NULL
|| sni_off == NULL) {
SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);