From 49b4ce848e261a49bc14b407bf186444cda4bcfd Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 30 Jun 2010 22:02:41 +0000 Subject: [PATCH] Extra robustness check: don't segfault if no socache provider selected 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/aaa/mod_authn_socache.c b/modules/aaa/mod_authn_socache.c index 83ecc83a48..0c358fc6cb 100644 --- a/modules/aaa/mod_authn_socache.c +++ b/modules/aaa/mod_authn_socache.c @@ -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) { -- 2.50.1