]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy_express: Fix possible use of DB handle after close.
authorYann Ylavic <ylavic@apache.org>
Tue, 29 Mar 2016 15:48:00 +0000 (15:48 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 29 Mar 2016 15:48:00 +0000 (15:48 +0000)
PR 59230.

Submitted by: Petr <pgajdos suse.cz>
Reviewed/Committed by: ylavic

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

CHANGES
modules/proxy/mod_proxy_express.c

diff --git a/CHANGES b/CHANGES
index 526b318f20b1551c705e89a3f775d048ebd77d4c..b33a29ca7017f33064007c8f811a7de6185f2a4b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_express: Fix possible use of DB handle after close.  PR 59230.
+     [Petr <pgajdos suse.cz>]
+     
   *) mod_http2: more efficient passing of response bodies with less contention
      and file bucket forwarding. [Stefan Eissing] 
      
index 9904fbbd7e82b178a09c9d27c344cefd24eec1d8..ec4b94a67d79b4985a9a19e7f05bc632649533a8 100644 (file)
@@ -145,13 +145,11 @@ static int xlate_name(request_rec *r)
     key.dsize = strlen(key.dptr);
 
     rv = apr_dbm_fetch(db, key, &val);
-    apr_dbm_close(db);
-    if (rv != APR_SUCCESS) {
-        return DECLINED;
+    if (rv == APR_SUCCESS) {
+        backend = apr_pstrmemdup(r->pool, val.dptr, val.dsize);
     }
-
-    backend = apr_pstrmemdup(r->pool, val.dptr, val.dsize);
-    if (!backend) {
+    apr_dbm_close(db);
+    if (rv != APR_SUCCESS || !backend) {
         return DECLINED;
     }