From 48e46f98ccf97427995eb41c6f28cc38705bdd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 14 Oct 2022 09:34:00 +0200 Subject: [PATCH] BUILD: ssl_sock: bind_conf uninitialized in ssl_sock_bind_verifycbk() Even if this cannot happen, ensure is initialized in this function to please some compilers. Takes the opportunity of this patch to replace an ABORT_NOW() by a BUG_ON() because if the variable values they test are not initialized, this is really because there is a bug. Must be backported to 2.6. --- src/ssl_sock.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 8d2019099..fbf4ee6a3 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -1713,7 +1713,7 @@ int ssl_sock_bind_verifycbk(int ok, X509_STORE_CTX *x_store) int err, depth; X509 *client_crt; STACK_OF(X509) *certs; - struct bind_conf *bind_conf; + struct bind_conf *bind_conf = NULL; struct quic_conn *qc = NULL; ssl = X509_STORE_CTX_get_ex_data(x_store, SSL_get_ex_data_X509_STORE_CTX_idx()); @@ -1734,10 +1734,7 @@ int ssl_sock_bind_verifycbk(int ok, X509_STORE_CTX *x_store) } #endif - if (!ctx || !bind_conf) { - /* Must never happen */ - ABORT_NOW(); - } + BUG_ON(!ctx || !bind_conf); ctx->xprt_st |= SSL_SOCK_ST_FL_VERIFY_DONE;