|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2017-04-10 05:58 UTC] krakjoe@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: krakjoe
[2017-04-10 05:58 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ mysqlnd allocates result objects in mysqlnd_result.c:1899 (mysqlnd_result_init): MYSQLND_RES * ret = mnd_pecalloc(1, alloc_size, persistent); Note that these objects may be allocated persistently if the underlying connection is persistent. Normally these objects will be free'd in mysqlnd_result.c:347 (mysqlnd_res::free_result_internal): mnd_pefree(result, result->persistent); Here, the persistency flag is respected. However, in some cases (query errors or connection loss), mysqlnd_ps.c will use mnd_efree() instead of mnd_pefree() to free a result object: line 132 (mysqlnd_stmt::store_result): mnd_efree(stmt->result); line 359 (mysqlnd_stmt_prepare_read_eof): mnd_efree(stmt->result); This will cause segfaults/"zend_mm_heap corrupted" in the above-mentioned cases. Test script: --------------- <?php $conn = new PDO("mysql:...", "...", "...", [PDO::ATTR_PERSISTENT => true, PDO::ATTR_EMULATE_PREPARES => false]); $conn->query("select (select 1 union select 2)"); Expected result: ---------------- Script executes successfully. Actual result: -------------- segfault