]> granicus.if.org Git - apache/commitdiff
Extra robustness check: don't segfault if no socache provider selected
authorNick Kew <niq@apache.org>
Wed, 30 Jun 2010 22:02:41 +0000 (22:02 +0000)
committerNick Kew <niq@apache.org>
Wed, 30 Jun 2010 22:02:41 +0000 (22:02 +0000)
and there's no compile-time default.

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

modules/aaa/mod_authn_socache.c

index 83ecc83a48f67c622db56260a5c07a367053715d..0c358fc6cb3e9c66d8aeb1b2ab5f159f63e7df22 100644 (file)
@@ -87,6 +87,13 @@ static int authn_cache_post_config(apr_pool_t *pconf, apr_pool_t *plog,
     const char *errmsg;
     static struct ap_socache_hints authn_cache_hints = {64, 32, 60000000};
 
+    if (socache_provider == NULL) {
+        ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, plog,
+                      "Please select a socache provider with AuthnCacheSOCache "
+                      "(no default found on this platform)");
+        return 500; /* An HTTP status would be a misnomer! */
+    }
+
     rv = ap_global_mutex_create(&authn_cache_mutex, NULL,
                                 authn_cache_id, NULL, s, pconf, 0);
     if (rv != APR_SUCCESS) {