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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmb@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

Pull requests:

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 27 16:01:27 2024 UTC