|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13569 ibase_fetch_row doesn't null terminate all strings?
Submitted: 2001-10-05 16:37 UTC Modified: 2001-10-09 11:13 UTC
From: erik at totalcirculation dot com Assigned:
Status: Closed Package: InterBase related
PHP Version: 4.0.4pl1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: erik at totalcirculation dot com
New email:
PHP Version: OS:


 [2001-10-05 16:37 UTC] erik at totalcirculation dot com
The summary says it all, I guess.  

$indexed = array();
$assoc = array();
$nullassoc = array();
while($row = ibase_fetch_row($sth)) {
       array_push($indexed, $row[0]);
       $assoc[$row[0]] = $row[1];
        $nullassoc["${row[0]}\0"] = $row[1];
foreach($indexed as $key=>$val) {
   echo "indexed key: '$key' val: '$val'<br>\n";
foreach($assoc as $key=>$val) {
   echo "assoc key: '$key' val: '$val'<br>\n";
foreach($nullassoc as $key=>$val) {
   echo "nullassoc key: '$key' val: '$val'<br>\n";
If you run this code with a select statement such as
select varcharcol, varcharcol2 from table, you should see the problem. You may need to run it a couple times to actually see it happen.

The problem could also be in the routine that handles 
$array[$key] = $val, as evidenced by the first runthrough,
where the values appear to be correctly null terminated.

Feel free to contact me with any questions or if this doesn't make sense!



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-05 22:02 UTC]
Any chance you could test agains the current code?  Grab the latest php4 snapshot tarball from
Some fixes were applied to the interbase extension to fix this a while ago, but they are not in the released 4.0.6 version.
 [2001-10-09 10:12 UTC] erik at totalcirculation dot com
Using the newest snapshot (php4-200110090600) the problem goes away, so it looks like it got fixed between 4.04pl1 and the current version.



PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 12:01:29 2024 UTC