|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-10-06 15:58 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2020-10-06 15:58 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jan 03 19:00:01 2026 UTC |
Description: ------------ odbc_result looks like it is initializing the result string to the length of the data in the field, but the defaultlrl is limits how much is returned, so the remaining bytes seem to be random uninitialized memory. Reproduce code: --------------- <?php $data = '000'; for($x=1;$x<12;$x++) $data .= $data; $db = odbc_connect('DSN', 'user', 'pass'); odbc_exec($db, 'CREATE TABLE Temp (id int, seq int, contents varchar(8000))'); odbc_exec($db, 'INSERT INTO Temp (id, seq, contents) VALUES (1, 1, \'' . $data . '\')'); $rst = odbc_exec($db, 'select * from Temp'); while(odbc_fetch_row($rst)) echo odbc_result($rst, 'contents'); odbc_free_result($rst); ?> Expected result: ---------------- 4096 '0's Actual result: -------------- 4096 '0's and 2048 bytes of binary data