From af7602497d7f8aff9e0958df14dea091c0e1f777 Mon Sep 17 00:00:00 2001 From: cpq Date: Tue, 30 Sep 2025 16:43:41 +0100 Subject: [PATCH] Squash warning --- mongoose.c | 2 +- src/tls_builtin.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 79f37300..f343f331 100644 --- a/mongoose.c +++ b/mongoose.c @@ -12415,7 +12415,7 @@ static int mg_tls_recv_cert(struct mg_connection *c, bool is_client) { if (ci == certs) { // First certificate in the chain is peer cert, check SAN if requested, // and store public key for further CertVerify step - if (tls->hostname != NULL && *tls->hostname != '\0' && + if (tls->hostname[0] != '\0' && mg_tls_verify_cert_san(cert, certsz, tls->hostname) <= 0 && mg_tls_verify_cert_cn(&ci->subj, tls->hostname) <= 0) { mg_error(c, "failed to verify hostname"); diff --git a/src/tls_builtin.c b/src/tls_builtin.c index 864e10a0..5bd02e56 100644 --- a/src/tls_builtin.c +++ b/src/tls_builtin.c @@ -1343,7 +1343,7 @@ static int mg_tls_recv_cert(struct mg_connection *c, bool is_client) { if (ci == certs) { // First certificate in the chain is peer cert, check SAN if requested, // and store public key for further CertVerify step - if (tls->hostname != NULL && *tls->hostname != '\0' && + if (tls->hostname[0] != '\0' && mg_tls_verify_cert_san(cert, certsz, tls->hostname) <= 0 && mg_tls_verify_cert_cn(&ci->subj, tls->hostname) <= 0) { mg_error(c, "failed to verify hostname");