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

==15445== Conditional jump or move depends on uninitialised value(s)
==15445==    at 0xAF3A23: odbc_bindcols (php_odbc.c:968)
==15445==    by 0xAF705C: zif_odbc_exec (php_odbc.c:1696)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 
==15445== Use of uninitialised value of size 8
==15445==    at 0xAF3A34: odbc_bindcols (php_odbc.c:968)
==15445==    by 0xAF705C: zif_odbc_exec (php_odbc.c:1696)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 
==15445== Conditional jump or move depends on uninitialised value(s)
==15445==    at 0xAF3C92: odbc_bindcols (php_odbc.c:1020)
==15445==    by 0xAF705C: zif_odbc_exec (php_odbc.c:1696)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 
==15445== Conditional jump or move depends on uninitialised value(s)
==15445==    at 0xAF3D35: odbc_bindcols (php_odbc.c:1027)
==15445==    by 0xAF705C: zif_odbc_exec (php_odbc.c:1696)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 
==15445== Conditional jump or move depends on uninitialised value(s)
==15445==    at 0xAF3DD8: odbc_bindcols (php_odbc.c:1034)
==15445==    by 0xAF705C: zif_odbc_exec (php_odbc.c:1696)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 
==15445== Conditional jump or move depends on uninitialised value(s)
==15445==    at 0xAF9567: zif_odbc_result (php_odbc.c:2158)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 
==15445== Conditional jump or move depends on uninitialised value(s)
==15445==    at 0xAF957E: zif_odbc_result (php_odbc.c:2158)
==15445==    by 0x1377638: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690)
==15445==    by 0x1377638: execute_ex (zend_vm_execute.h:54538)
==15445==    by 0x139F379: zend_execute (zend_vm_execute.h:59962)
==15445==    by 0x1155912: zend_execute_scripts (zend.c:1564)
==15445==    by 0x1044ECB: php_execute_script (main.c:2467)
==15445==    by 0x13A4F99: do_cli (php_cli.c:1011)
==15445==    by 0x13A6A57: main (php_cli.c:1404)
==15445== 

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (2 days ago)

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