]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* mod_authn_dbd: apr_pstrdup dbd_password and dbd_hash to fix use-after-free
authorJan Kaluža <jkaluza@apache.org>
Tue, 3 Mar 2015 11:12:18 +0000 (11:12 +0000)
committerJan Kaluža <jkaluza@apache.org>
Tue, 3 Mar 2015 11:12:18 +0000 (11:12 +0000)
bug with postgresql

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

modules/aaa/mod_authn_dbd.c

index 421295bfe42064d786e3a3406156ffb250c7ea51..4beceabf9219e397c008b930feda3bbd1a27760a 100644 (file)
@@ -174,7 +174,8 @@ static authn_status authn_dbd_password(request_rec *r, const char *user,
                 i++;
             }
 #endif
-            dbd_password = apr_dbd_get_entry(dbd->driver, row, 0);
+            dbd_password = apr_pstrdup(r->pool,
+                                       apr_dbd_get_entry(dbd->driver, row, 0));
         }
         /* we can't break out here or row won't get cleaned up */
     }
@@ -269,7 +270,8 @@ static authn_status authn_dbd_realm(request_rec *r, const char *user,
                 i++;
             }
 #endif
-            dbd_hash = apr_dbd_get_entry(dbd->driver, row, 0);
+            dbd_hash = apr_pstrdup(r->pool,
+                                   apr_dbd_get_entry(dbd->driver, row, 0));
         }
         /* we can't break out here or row won't get cleaned up */
     }