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

Valgrind Report for ext/odbc/tests/bug60616.phpt ('odbc_exec(): Getting accurate unicode data from query')

Script

1: <?php
2:
3:
// Test strings
4:
mb_internal_encoding("EUC_JP");
5:
$euc_jp_base64 'pdal6aWkpcCl676uyqo=';
6:
$euc_jp base64_decode($euc_jp_base64);
7:
$ascii 'abcdefghijklmnopqrstuvwxyz;]=#0123456789';
8:
9: include 
'config.inc';
10:
ini_set("odbc.defaultlrl"4); // Set artificially low
11:
12:
$conn odbc_connect($dsn$user$pass);
13:
14:
odbc_exec($conn'CREATE DATABASE odbcTEST ENCODING=\'EUC_JP\'');
15:
16:
odbc_exec($conn'CREATE TABLE FOO (ID INT, CHAR_COL CHAR(200), VARCHAR_COL VARCHAR(200), TEXT_COL TEXT)');
17:
18:
odbc_exec($conn"INSERT INTO FOO(ID, CHAR_COL, VARCHAR_COL, TEXT_COL) VALUES (1, '$euc_jp', '$euc_jp', '$euc_jp')");
19:
odbc_exec($conn"INSERT INTO FOO(ID, CHAR_COL, VARCHAR_COL, TEXT_COL) VALUES (2, '$ascii', '$ascii', '$ascii')");
20:
21:
$res odbc_exec($conn'SELECT * FROM FOO ORDER BY ID ASC');
22:
23: while(
odbc_fetch_row($res)) {
24:     
$char_col odbc_result($res"CHAR_COL");
25:     
$varchar_col odbc_result($res"VARCHAR_COL");
26:     
$id odbc_result($res"ID");
27:     
$text_col "";
28:     while ((
$chunk=odbc_result($res"TEXT_COL")) !== false) {
29:         
$text_col .= $chunk;
30:     }
31:
32:     if (
$id == 1) {
33:         
$euc_jp_check $euc_jp str_repeat(" ", (200 mb_strlen($euc_jp)));
34:         if (
strcmp($char_col$euc_jp_check) == && strcmp($varchar_col$euc_jp) == &&
35:             
strcmp($text_col$euc_jp) == 0) {
36:             print 
"EUC-JP matched\n";
37:         } else {
38:             print 
"EUC-JP mismatched\n";
39:         }
40:     } else {
41:         
$ascii_check $ascii str_repeat(" ", (200 strlen($ascii)));
42:         if (
strcmp($char_col$ascii_check) == && strcmp($varchar_col$ascii) == &&
43:             
strcmp($text_col$ascii) == 0) {
44:             print 
"ASCII matched\n";
45:         } else {
46:             print 
"ASCII mismatched\n";
47:         }
48:     }
49: }
50:
51:
?>
52:

Report

==31447== Conditional jump or move depends on uninitialised value(s)
==31447==    at 0x97A832: odbc_bindcols (php_odbc.c:966)
==31447==    by 0x97DE5E: zif_odbc_exec (php_odbc.c:1692)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 
==31447== Use of uninitialised value of size 8
==31447==    at 0x97A843: odbc_bindcols (php_odbc.c:966)
==31447==    by 0x97DE5E: zif_odbc_exec (php_odbc.c:1692)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 
==31447== Conditional jump or move depends on uninitialised value(s)
==31447==    at 0x97AAA1: odbc_bindcols (php_odbc.c:1018)
==31447==    by 0x97DE5E: zif_odbc_exec (php_odbc.c:1692)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 
==31447== Conditional jump or move depends on uninitialised value(s)
==31447==    at 0x97AB44: odbc_bindcols (php_odbc.c:1025)
==31447==    by 0x97DE5E: zif_odbc_exec (php_odbc.c:1692)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 
==31447== Conditional jump or move depends on uninitialised value(s)
==31447==    at 0x97ABE7: odbc_bindcols (php_odbc.c:1032)
==31447==    by 0x97DE5E: zif_odbc_exec (php_odbc.c:1692)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 
==31447== Conditional jump or move depends on uninitialised value(s)
==31447==    at 0x980369: zif_odbc_result (php_odbc.c:2154)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 
==31447== Conditional jump or move depends on uninitialised value(s)
==31447==    at 0x980380: zif_odbc_result (php_odbc.c:2154)
==31447==    by 0x120C19E: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==31447==    by 0x120C19E: execute_ex (zend_vm_execute.h:55287)
==31447==    by 0x1233E43: zend_execute (zend_vm_execute.h:60687)
==31447==    by 0xFEB514: zend_execute_scripts (zend.c:1573)
==31447==    by 0xED9F82: php_execute_script (main.c:2636)
==31447==    by 0x1239C09: do_cli (php_cli.c:997)
==31447==    by 0x123B6C7: main (php_cli.c:1390)
==31447== 

 

Generated at Wed, 17 Oct 2018 05:34:51 +0000 (2 hours ago)

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