php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79038 PDOStatement::nextRowset() leaks column values
Submitted: 2019-12-27 12:08 UTC Modified: 2020-02-17 21:57 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: PDO ODBC
PHP Version: 7.3Git-2019-12-27 (Git) OS: *
Private report: No CVE-ID: None
 [2019-12-27 12:08 UTC] cmb@php.net
Description:
------------
The basic problem is that PDO core sets the `column_count` to
zero, before the driver specific implementation of `next_rowset`
is called, so the column values are never freed.  Since PDO_ODBC
does not implement `cursor_closer`, the memory leak also happens
when `PDOStatement::closeCursor()` called.

The leaks can be seen when the PDO_ODBC test suite is run on a
debug build on PHP-7.4, and also for PHP-7.3 when run with
valgrind or another leak checker.


Test script:
---------------
php run-tests.php ext/pdo_odbc/tests

Expected result:
----------------
no memory leaks

Actual result:
--------------
<https://ci.appveyor.com/project/php/php-src/builds/29760248/job/qrhd1plp255gxwmy#L4986>

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-27 12:08 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-12-27 12:29 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #79038: PDOStatement::nextRowset() leaks column values
On GitHub:  https://github.com/php/php-src/pull/5033
Patch:      https://github.com/php/php-src/pull/5033.patch
 [2019-12-27 12:30 UTC] cmb@php.net
-Assigned To: cmb +Assigned To:
 [2020-02-17 21:56 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=08073b06581c6dc9234cfb2e9b187a598154c8ab
Log: Fix #79038: PDOStatement::nextRowset() leaks column values
 [2020-02-17 21:56 UTC] cmb@php.net
-Status: Open +Status: Closed
 [2020-02-17 21:57 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Mar 31 23:01:23 2020 UTC