From 228a45dafeceade8b62ee7d68c29a540489084a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kalu=C5=BEa?= Date: Tue, 3 Mar 2015 11:12:18 +0000 Subject: [PATCH] * mod_authn_dbd: apr_pstrdup dbd_password and dbd_hash to fix use-after-free 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/aaa/mod_authn_dbd.c b/modules/aaa/mod_authn_dbd.c index 421295bfe42..4beceabf921 100644 --- a/modules/aaa/mod_authn_dbd.c +++ b/modules/aaa/mod_authn_dbd.c @@ -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 */ } -- 2.47.3