]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_authz_dbd: Avoid a crash when lacking correct DB access permissions. PR 57868.
authorYann Ylavic <ylavic@apache.org>
Wed, 1 Jul 2015 14:37:00 +0000 (14:37 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 1 Jul 2015 14:37:00 +0000 (14:37 +0000)
Submitted by: Jose Kahan <jose w3.org>

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

CHANGES
docs/log-message-tags/next-number
modules/aaa/mod_authz_dbd.c

diff --git a/CHANGES b/CHANGES
index 22d4e00c33d862bae2c14f035c5326bb04f0088f..3a21818c64cf7b7f95038b8fed19f50f72a18e68 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_authz_dbd: Avoid a crash when lacking correct DB access permissions.
+     PR 57868. [Jose Kahan <jose w3.org>, Yann Ylavic]
+
   *) http: Fix LimitRequestBody checks when there is no more bytes to read.
      [Michael Kaufmann <mail michael-kaufmann.ch>]
 
index 6ba94a4313d83259f6026fdd401ed032bd3180ad..01d6fdc12aab11b796a48b14e8b751e3675d72bd 100644 (file)
@@ -1 +1 @@
-2902
+2904
index a165eb0ec91c460dd2c310f464c93efb407d37d7..628a165dea9e0eb734e405ea6e9bc297e78b2d03 100644 (file)
@@ -126,6 +126,13 @@ static int authz_dbd_login(request_rec *r, authz_dbd_cfg *cfg,
                       "No query configured for %s!", action);
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    if (dbd == NULL) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02902)
+                      "No db handle available for %s! "
+                      "Check your database access",
+                      action);
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
     query = apr_hash_get(dbd->prepared, cfg->query, APR_HASH_KEY_STRING);
     if (query == NULL) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01643)
@@ -212,6 +219,12 @@ static int authz_dbd_group_query(request_rec *r, authz_dbd_cfg *cfg,
                       "No query configured for dbd-group!");
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    if (dbd == NULL) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02903)
+                      "No db handle available for dbd-query! "
+                      "Check your database access");
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
     query = apr_hash_get(dbd->prepared, cfg->query, APR_HASH_KEY_STRING);
     if (query == NULL) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01650)