|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35784 segfault on PDOStatement::execute() with zend.ze1_compatibility_mode = On
Submitted: 2005-12-23 11:30 UTC Modified: 2005-12-24 18:43 UTC
From: crocodile2u at yandex dot ru Assigned: wez (profile)
Status: Closed Package: PDO related
PHP Version: 5CVS-2005-12-23 (snap) OS: linux fedora core 4
Private report: No CVE-ID: None
 [2005-12-23 11:30 UTC] crocodile2u at yandex dot ru
see summary

Reproduce code:
$pdo = & new PDO('mysql:dbname=test;host=localhost', 'root', 'vitek');

$stmt = $pdo->prepare('SHOW TABLES');


Expected result:
object(PDOStatement)#2 (1) {
  string(11) "SHOW TABLES"

Actual result:
Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-23 11:35 UTC] crocodile2u at yandex dot ru
[sorry if I'm casually duplicating this...]
(gdb) bt
#0  pdo_parse_params (stmt=0x8ffacbc, inquery=0x0, inquery_len=33, outquery=0x8ffad08, outquery_len=0x21)
    at /new-ext3/src/php5.1-200512230530/ext/pdo/pdo_sql_parser.c:93
#1  0x08137bbd in zif_PDOStatement_execute (ht=0, return_value=0x9008c84, return_value_ptr=0x0, this_ptr=0x9008c64,
    return_value_used=0) at /new-ext3/src/php5.1-200512230530/ext/pdo/pdo_stmt.c:410
#2  0x08214ecc in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe02e80)
    at /new-ext3/src/php5.1-200512230530/Zend/zend_vm_execute.h:192
#3  0x082146d1 in execute (op_array=0x900431c) at /new-ext3/src/php5.1-200512230530/Zend/zend_vm_execute.h:92
#4  0x081fea5f in zend_execute_scripts (type=8, retval=Variable "retval" is not available.
) at /new-ext3/src/php5.1-200512230530/Zend/zend.c:1101
#5  0x081caefe in php_execute_script (primary_file=0xbfe05274) at /new-ext3/src/php5.1-200512230530/main/main.c:1720
#6  0x082772e0 in main (argc=2, argv=0xbfe05364) at /new-ext3/src/php5.1-200512230530/sapi/cli/php_cli.c:1077
 [2005-12-24 18:43 UTC]
Works fine in latest CVS. FYI in PHP 5.1 objects are always being passed by reference so you don't need the & in front of new.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 02:03:37 2021 UTC