PHP  
 PHP_7_1
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

==2219== Invalid read of size 2
==2219==    at 0x4C2BA38: memcpy (vg_replace_strmem.c:1023)
==2219==    by 0xA8AC53: zend_string_init (zend_string.h:160)
==2219==    by 0xA8AC53: odbc_stmt_describe (odbc_stmt.c:615)
==2219==    by 0xA5B20A: pdo_stmt_describe_columns (pdo_stmt.c:200)
==2219==    by 0xA5763A: zim_PDO_query (pdo_dbh.c:1103)
==2219==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2219==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2219==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2219==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2219==    by 0xEDF990: php_execute_script (main.c:2577)
==2219==    by 0x123291D: do_cli (php_cli.c:993)
==2219==    by 0x12342C4: main (php_cli.c:1381)
==2219==  Address 0x151b8128 is 0 bytes after a block of size 168 alloc'd
==2219==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2219==    by 0xF85A17: __zend_malloc (zend_alloc.c:2838)
==2219==    by 0xF8409A: _emalloc (zend_alloc.c:2429)
==2219==    by 0xF84927: _safe_emalloc (zend_alloc.c:2488)
==2219==    by 0xF84D39: _ecalloc (zend_alloc.c:2511)
==2219==    by 0xA892B6: odbc_stmt_execute (odbc_stmt.c:275)
==2219==    by 0xA575C7: zim_PDO_query (pdo_dbh.c:1099)
==2219==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2219==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2219==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2219==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2219==    by 0xEDF990: php_execute_script (main.c:2577)
==2219== 
==2219== Invalid read of size 2
==2219==    at 0x4C2BA50: memcpy (vg_replace_strmem.c:1023)
==2219==    by 0xA8AC53: zend_string_init (zend_string.h:160)
==2219==    by 0xA8AC53: odbc_stmt_describe (odbc_stmt.c:615)
==2219==    by 0xA5B20A: pdo_stmt_describe_columns (pdo_stmt.c:200)
==2219==    by 0xA5763A: zim_PDO_query (pdo_dbh.c:1103)
==2219==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2219==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2219==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2219==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2219==    by 0xEDF990: php_execute_script (main.c:2577)
==2219==    by 0x123291D: do_cli (php_cli.c:993)
==2219==    by 0x12342C4: main (php_cli.c:1381)
==2219==  Address 0x151b812a is 2 bytes after a block of size 168 alloc'd
==2219==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2219==    by 0xF85A17: __zend_malloc (zend_alloc.c:2838)
==2219==    by 0xF8409A: _emalloc (zend_alloc.c:2429)
==2219==    by 0xF84927: _safe_emalloc (zend_alloc.c:2488)
==2219==    by 0xF84D39: _ecalloc (zend_alloc.c:2511)
==2219==    by 0xA892B6: odbc_stmt_execute (odbc_stmt.c:275)
==2219==    by 0xA575C7: zim_PDO_query (pdo_dbh.c:1099)
==2219==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2219==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2219==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2219==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2219==    by 0xEDF990: php_execute_script (main.c:2577)
==2219== 
==2219== Invalid read of size 1
==2219==    at 0x4C2BA70: memcpy (vg_replace_strmem.c:1023)
==2219==    by 0xA8AC53: zend_string_init (zend_string.h:160)
==2219==    by 0xA8AC53: odbc_stmt_describe (odbc_stmt.c:615)
==2219==    by 0xA5B20A: pdo_stmt_describe_columns (pdo_stmt.c:200)
==2219==    by 0xA5763A: zim_PDO_query (pdo_dbh.c:1103)
==2219==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2219==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2219==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2219==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2219==    by 0xEDF990: php_execute_script (main.c:2577)
==2219==    by 0x123291D: do_cli (php_cli.c:993)
==2219==    by 0x12342C4: main (php_cli.c:1381)
==2219==  Address 0x151b8198 is 0 bytes after a block of size 40 alloc'd
==2219==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==2219==    by 0xF85A17: __zend_malloc (zend_alloc.c:2838)
==2219==    by 0xF8409A: _emalloc (zend_alloc.c:2429)
==2219==    by 0xF84927: _safe_emalloc (zend_alloc.c:2488)
==2219==    by 0xF84D39: _ecalloc (zend_alloc.c:2511)
==2219==    by 0xA5B1C8: pdo_stmt_describe_columns (pdo_stmt.c:197)
==2219==    by 0xA5763A: zim_PDO_query (pdo_dbh.c:1103)
==2219==    by 0x10CF75C: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1097)
==2219==    by 0x10C8C22: execute_ex (zend_vm_execute.h:432)
==2219==    by 0x10C986F: zend_execute (zend_vm_execute.h:474)
==2219==    by 0xFEB9B0: zend_execute_scripts (zend.c:1482)
==2219==    by 0xEDF990: php_execute_script (main.c:2577)
==2219== 

 

Generated at Fri, 01 Dec 2017 18:56:15 +0000 (10 days ago)

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