From: Christophe Jaillet Date: Mon, 10 Aug 2015 21:31:05 +0000 (+0000) Subject: Avoid a crash when lacking correct DB access permissions. PR 57868. X-Git-Tag: 2.5.0-alpha~2970 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bce6978fbe6b03d1adc0b92029770f0565f96cf;p=thirdparty%2Fapache%2Fhttpd.git Avoid a crash when lacking correct DB access permissions. PR 57868. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1695170 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index e75f40a40b5..ff481a2e553 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -2963 +2964 diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 3135e5e0c6d..b25acdec0df 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1370,6 +1370,13 @@ static char *lookup_map_dbd(request_rec *r, char *key, const char *label) char *ret = NULL; int n = 0; ap_dbd_t *db = dbd_acquire(r); + + if (db == NULL) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02963) + "rewritemap: No db handle available! " + "Check your database access"); + return NULL; + } stmt = apr_hash_get(db->prepared, label, APR_HASH_KEY_STRING);