This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.

[2012-03-16 21:17 UTC] a dot lukyanov at hostcomm dot ru

I'm sorry, but current code in trunk not solved the problem.
Buffer increases on each iteration, because heap_p is bigger than heap_buf:
- snprintf(heap_p, heap_buf_size - (heap_buf - heap_p), "%s\n", result);
+ snprintf(heap_p, heap_buf_size - (heap_p - heap_buf), "%s\n", result);
This line should be corrected too:
- heap_p += line_len +2;
+ heap_p += line_len +1;
On each iteration I need overwrite last zero byte. In current code I recieve single line from Firebird server instead of multiline output (if not catch segfault).
Sorry for my bad English. Thanks.

This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
iliaa fixed it in svn for all branches
Thanks

This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.