diff options
author | Yann Ylavic <ylavic@apache.org> | 2015-07-01 16:37:00 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2015-07-01 16:37:00 +0200 |
commit | 54bf3a248e3d0fba5fce2e6afcf1f4dfda6774a4 (patch) | |
tree | 332a5554bd73532e3fca485c3504dd5b1a701257 /modules/aaa | |
parent | http: follow up to r1685345. (diff) | |
download | apache2-54bf3a248e3d0fba5fce2e6afcf1f4dfda6774a4.tar.xz apache2-54bf3a248e3d0fba5fce2e6afcf1f4dfda6774a4.zip |
mod_authz_dbd: Avoid a crash when lacking correct DB access permissions. PR 57868.
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
Diffstat (limited to 'modules/aaa')
-rw-r--r-- | modules/aaa/mod_authz_dbd.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/aaa/mod_authz_dbd.c b/modules/aaa/mod_authz_dbd.c index a165eb0ec9..628a165dea 100644 --- a/modules/aaa/mod_authz_dbd.c +++ b/modules/aaa/mod_authz_dbd.c @@ -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) |