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

==27028== Invalid read of size 2
==27028==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==27028==    by 0x9D4572: zend_string_init (zend_string.h:156)
==27028==    by 0x9D4572: odbc_stmt_describe (odbc_stmt.c:613)
==27028==    by 0x99D601: pdo_stmt_describe_columns (pdo_stmt.c:198)
==27028==    by 0x99913A: zim_PDO_query (pdo_dbh.c:1097)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028==    by 0x1238014: main (php_cli.c:1390)
==27028==  Address 0x18ae9448 is 0 bytes after a block of size 168 alloc'd
==27028==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==27028==    by 0xF8058A: __zend_malloc (zend_alloc.c:2893)
==27028==    by 0xF7C5AB: _emalloc (zend_alloc.c:2483)
==27028==    by 0xF7F950: _ecalloc (zend_alloc.c:2568)
==27028==    by 0x9D2D2C: odbc_stmt_execute (odbc_stmt.c:273)
==27028==    by 0x9990B3: zim_PDO_query (pdo_dbh.c:1093)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028==    by 0x1238014: main (php_cli.c:1390)
==27028== 
==27028== Invalid read of size 2
==27028==    at 0x4C2BA50: memcpy (vg_replace_strmem.c:1023)
==27028==    by 0x9D4572: zend_string_init (zend_string.h:156)
==27028==    by 0x9D4572: odbc_stmt_describe (odbc_stmt.c:613)
==27028==    by 0x99D601: pdo_stmt_describe_columns (pdo_stmt.c:198)
==27028==    by 0x99913A: zim_PDO_query (pdo_dbh.c:1097)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028==    by 0x1238014: main (php_cli.c:1390)
==27028==  Address 0x18ae944a is 2 bytes after a block of size 168 alloc'd
==27028==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==27028==    by 0xF8058A: __zend_malloc (zend_alloc.c:2893)
==27028==    by 0xF7C5AB: _emalloc (zend_alloc.c:2483)
==27028==    by 0xF7F950: _ecalloc (zend_alloc.c:2568)
==27028==    by 0x9D2D2C: odbc_stmt_execute (odbc_stmt.c:273)
==27028==    by 0x9990B3: zim_PDO_query (pdo_dbh.c:1093)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028==    by 0x1238014: main (php_cli.c:1390)
==27028== 
==27028== Invalid read of size 1
==27028==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==27028==    by 0x9D4572: zend_string_init (zend_string.h:156)
==27028==    by 0x9D4572: odbc_stmt_describe (odbc_stmt.c:613)
==27028==    by 0x99D601: pdo_stmt_describe_columns (pdo_stmt.c:198)
==27028==    by 0x99913A: zim_PDO_query (pdo_dbh.c:1097)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028==    by 0x1238014: main (php_cli.c:1390)
==27028==  Address 0x18ae94b8 is 40 bytes inside a block of size 1,096 free'd
==27028==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==27028==    by 0xCDBB05A: ??? (in /usr/lib64/libodbc.so.2.0.0)
==27028==    by 0xCD893C8: SQLColAttribute (in /usr/lib64/libodbc.so.2.0.0)
==27028==    by 0x9D4353: odbc_stmt_describe (odbc_stmt.c:600)
==27028==    by 0x99D601: pdo_stmt_describe_columns (pdo_stmt.c:198)
==27028==    by 0x99913A: zim_PDO_query (pdo_dbh.c:1097)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028==    by 0x1238014: main (php_cli.c:1390)
==27028==  Block was alloc'd at
==27028==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==27028==    by 0xCDC0749: ??? (in /usr/lib64/libodbc.so.2.0.0)
==27028==    by 0xCDC2913: ??? (in /usr/lib64/libodbc.so.2.0.0)
==27028==    by 0xCD90668: SQLDescribeCol (in /usr/lib64/libodbc.so.2.0.0)
==27028==    by 0x9D40A9: odbc_stmt_describe (odbc_stmt.c:571)
==27028==    by 0x99D601: pdo_stmt_describe_columns (pdo_stmt.c:198)
==27028==    by 0x99913A: zim_PDO_query (pdo_dbh.c:1097)
==27028==    by 0x120BF67: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1112)
==27028==    by 0x120BF67: execute_ex (zend_vm_execute.h:54847)
==27028==    by 0x1230790: zend_execute (zend_vm_execute.h:60223)
==27028==    by 0xFEBDCB: zend_execute_scripts (zend.c:1608)
==27028==    by 0xED9F70: php_execute_script (main.c:2643)
==27028==    by 0x1236556: do_cli (php_cli.c:997)
==27028== 

 

Generated at Tue, 06 Nov 2018 09:43:32 +0000 (11 days ago)

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