]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_ssl: fix NULL dereference in OCSP responder URI parsing
authorJoe Orton <jorton@apache.org>
Fri, 17 Jul 2026 12:12:12 +0000 (12:12 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 17 Jul 2026 12:12:12 +0000 (12:12 +0000)
* modules/ssl/ssl_engine_ocsp.c (determine_responder_uri): Check
  u->scheme is non-NULL before calling ap_cstr_casecmp(), since
  apr_uri_parse() can succeed with a NULL scheme for scheme-less URIs.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub: PR #685

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1936259 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_ocsp.c

index 539ed103eae38647fb86f7e5b7b27c7502dd270c..6a03fb417448ce0c65a89b15a92f30a005501b31 100644 (file)
@@ -80,7 +80,7 @@ static apr_uri_t *determine_responder_uri(SSLSrvConfigRec *sc, X509 *cert,
     }
 
     rv = apr_uri_parse(p, s, u);
-    if (rv || !u->hostname) {
+    if (rv || !u->hostname || !u->scheme) {
         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, c, APLOGNO(01919)
                       "failed to parse OCSP responder URI '%s'", s);
         return NULL;