summaryrefslogtreecommitdiffstats
path: root/modules/session
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2012-11-13 22:03:10 +0100
committerChristophe Jaillet <jailletc36@apache.org>2012-11-13 22:03:10 +0100
commitb40d4dc8808aa07af296ea76e64091b8b3046f88 (patch)
treed386ab612b90c6075b89fa7a64d8db76ee0145ab /modules/session
parentfollowup to r1348036, MSSDK's WinLdap.h uses an enum for LDAP_* status codes,... (diff)
downloadapache2-b40d4dc8808aa07af296ea76e64091b8b3046f88.tar.xz
apache2-b40d4dc8808aa07af296ea76e64091b8b3046f88.zip
mod_session_dbd: fix a segmentation fault in the function dbd_remove.
The segmentation fault is caused by an uninitialized function pointer session_dbd_acquire_fn. PR 53452 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1408958 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/session')
-rw-r--r--modules/session/mod_session_dbd.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/modules/session/mod_session_dbd.c b/modules/session/mod_session_dbd.c
index a1fbdc797b..59575ed558 100644
--- a/modules/session/mod_session_dbd.c
+++ b/modules/session/mod_session_dbd.c
@@ -333,18 +333,12 @@ static apr_status_t dbd_remove(request_rec * r, const char *key)
{
apr_status_t rv;
+ ap_dbd_t *dbd;
apr_dbd_prepared_t *statement;
int rows = 0;
session_dbd_dir_conf *conf = ap_get_module_config(r->per_dir_config,
&session_dbd_module);
- ap_dbd_t *dbd = session_dbd_acquire_fn(r);
- if (dbd == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01861)
- "failed to acquire database connection to remove "
- "session with key '%s'", key);
- return APR_EGENERAL;
- }
if (conf->deletelabel == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01862)
@@ -352,15 +346,13 @@ static apr_status_t dbd_remove(request_rec * r, const char *key)
return APR_EGENERAL;
}
- statement = apr_hash_get(dbd->prepared, conf->deletelabel,
- APR_HASH_KEY_STRING);
- if (statement == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01863)
- "prepared statement could not be found for "
- "SessionDBDdeletelabel with the label '%s'",
- conf->deletelabel);
- return APR_EGENERAL;
- }
+ rv = dbd_init(r, conf->deletelabel, &dbd, &statement);
+ if (rv != APR_SUCCESS) {
+ // No need to do additional error logging here, it has already
+ // been done in dbd_init if needed
+ return rv;
+ }
+
rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows, statement,
key, NULL);
if (rv != APR_SUCCESS) {