PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/pdo_odbc/tests/bug_69356.phpt ('ODBC PDO Common: Bug #69356 (PDOStatement::debugDumpParams() truncates query)')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
5:
$db PDOTest::factory();
6:
$db->setAttribute(PDO::ATTR_EMULATE_PREPAREStrue);
7:
$stmt $db->query("
8:     SELECT '
9:         Dumps the informations contained by a prepared statement directly on the output. It will provide the SQL query in use, the number of parameters used (Params), the list of parameters, with their name, type (paramtype) as an integer, their key name or position, and the position in the query (if this is supported by the PDO driver, otherwise, it will be -1).
10:         This is a debug function, which dump directly the data on the normal output.
11:         Tip:
12:         As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example).
13:         This will only dumps the parameters in the statement at the moment of the dump. Extra parameters are not stored in the statement, and not displayed.
14:     '
15: "
);
16:
var_dump($stmt->debugDumpParams());
17:
?>
18:

Report

==1359== Invalid read of size 2
==1359==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==1359==    by 0xAEEEA0: zend_string_init (zend_string.h:172)
==1359==    by 0xAEEEA0: odbc_stmt_describe (odbc_stmt.c:615)
==1359==    by 0xABC06C: pdo_stmt_describe_columns (pdo_stmt.c:200)
==1359==    by 0xAB7D00: zim_PDO_query (pdo_dbh.c:1108)
==1359==    by 0x11C18B3: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==1359==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==1359==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==1359==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==1359==    by 0xFD0CE5: php_execute_script (main.c:2566)
==1359==    by 0x133FA79: do_cli (php_cli.c:1011)
==1359==    by 0x134142D: main (php_cli.c:1404)
==1359==  Address 0x17a66c28 is 0 bytes after a block of size 168 alloc'd
==1359==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==1359==    by 0x10777DB: __zend_malloc (zend_alloc.c:2811)
==1359==    by 0x1075EF1: _emalloc (zend_alloc.c:2413)
==1359==    by 0x107677F: _safe_emalloc (zend_alloc.c:2472)
==1359==    by 0x1076B91: _ecalloc (zend_alloc.c:2495)
==1359==    by 0xAED50E: odbc_stmt_execute (odbc_stmt.c:275)
==1359==    by 0xAB7C8D: zim_PDO_query (pdo_dbh.c:1104)
==1359==    by 0x11C18B3: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==1359==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==1359==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==1359==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==1359==    by 0xFD0CE5: php_execute_script (main.c:2566)
==1359== 
==1359== Invalid read of size 2
==1359==    at 0x4C2BA50: memcpy (vg_replace_strmem.c:1023)
==1359==    by 0xAEEEA0: zend_string_init (zend_string.h:172)
==1359==    by 0xAEEEA0: odbc_stmt_describe (odbc_stmt.c:615)
==1359==    by 0xABC06C: pdo_stmt_describe_columns (pdo_stmt.c:200)
==1359==    by 0xAB7D00: zim_PDO_query (pdo_dbh.c:1108)
==1359==    by 0x11C18B3: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==1359==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==1359==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==1359==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==1359==    by 0xFD0CE5: php_execute_script (main.c:2566)
==1359==    by 0x133FA79: do_cli (php_cli.c:1011)
==1359==    by 0x134142D: main (php_cli.c:1404)
==1359==  Address 0x17a66c2a is 2 bytes after a block of size 168 alloc'd
==1359==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==1359==    by 0x10777DB: __zend_malloc (zend_alloc.c:2811)
==1359==    by 0x1075EF1: _emalloc (zend_alloc.c:2413)
==1359==    by 0x107677F: _safe_emalloc (zend_alloc.c:2472)
==1359==    by 0x1076B91: _ecalloc (zend_alloc.c:2495)
==1359==    by 0xAED50E: odbc_stmt_execute (odbc_stmt.c:275)
==1359==    by 0xAB7C8D: zim_PDO_query (pdo_dbh.c:1104)
==1359==    by 0x11C18B3: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==1359==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==1359==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==1359==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==1359==    by 0xFD0CE5: php_execute_script (main.c:2566)
==1359== 
==1359== Invalid read of size 1
==1359==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==1359==    by 0xAEEEA0: zend_string_init (zend_string.h:172)
==1359==    by 0xAEEEA0: odbc_stmt_describe (odbc_stmt.c:615)
==1359==    by 0xABC06C: pdo_stmt_describe_columns (pdo_stmt.c:200)
==1359==    by 0xAB7D00: zim_PDO_query (pdo_dbh.c:1108)
==1359==    by 0x11C18B3: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==1359==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==1359==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==1359==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==1359==    by 0xFD0CE5: php_execute_script (main.c:2566)
==1359==    by 0x133FA79: do_cli (php_cli.c:1011)
==1359==    by 0x134142D: main (php_cli.c:1404)
==1359==  Address 0x17a66c98 is 8 bytes after a block of size 32 alloc'd
==1359==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==1359==    by 0x10777DB: __zend_malloc (zend_alloc.c:2811)
==1359==    by 0x1075EF1: _emalloc (zend_alloc.c:2413)
==1359==    by 0x107677F: _safe_emalloc (zend_alloc.c:2472)
==1359==    by 0x1076B91: _ecalloc (zend_alloc.c:2495)
==1359==    by 0xABC02A: pdo_stmt_describe_columns (pdo_stmt.c:197)
==1359==    by 0xAB7D00: zim_PDO_query (pdo_dbh.c:1108)
==1359==    by 0x11C18B3: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1032)
==1359==    by 0x1339863: execute_ex (zend_vm_execute.h:59726)
==1359==    by 0x1339EDB: zend_execute (zend_vm_execute.h:63763)
==1359==    by 0x10DF02D: zend_execute_scripts (zend.c:1494)
==1359==    by 0xFD0CE5: php_execute_script (main.c:2566)
==1359== 

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (14 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.