Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2113910FA1 for ; Tue, 3 Mar 2015 11:12:24 +0000 (UTC) Received: (qmail 50542 invoked by uid 500); 3 Mar 2015 11:12:19 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 50466 invoked by uid 500); 3 Mar 2015 11:12:18 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 50457 invoked by uid 99); 3 Mar 2015 11:12:18 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 11:12:18 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id CF50FAC02BD for ; Tue, 3 Mar 2015 11:12:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1663647 - /httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c Date: Tue, 03 Mar 2015 11:12:18 -0000 To: cvs@httpd.apache.org From: jkaluza@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150303111218.CF50FAC02BD@hades.apache.org> Author: jkaluza Date: Tue Mar 3 11:12:18 2015 New Revision: 1663647 URL: http://svn.apache.org/r1663647 Log: * mod_authn_dbd: apr_pstrdup dbd_password and dbd_hash to fix use-after-free bug with postgresql Modified: httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c Modified: httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c?rev=1663647&r1=1663646&r2=1663647&view=diff ============================================================================== --- httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c (original) +++ httpd/httpd/trunk/modules/aaa/mod_authn_dbd.c Tue Mar 3 11:12:18 2015 @@ -174,7 +174,8 @@ static authn_status authn_dbd_password(r 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(requ 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 */ }