php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30907 ibase_query() crashes when inserting a -1 into a Interbase TIMESTAMP field
Submitted: 2004-11-26 14:24 UTC Modified: 2007-11-08 19:48 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: sandell at winwap dot com Assigned: abies (profile)
Status: Closed Package: InterBase related
PHP Version: 5CVS-2005-03-01 OS: WinXP Pro (SP2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
28 + 38 = ?
Subscribe to this entry?

 
 [2004-11-26 14:24 UTC] sandell at winwap dot com
Description:
------------
When inserting a -1 into a TIMESTAMP field in an interbase 7 database Apache crashes. When looking at the "More info" in the WinXP crash dialog it shows that it was mod "php_interbase.dll" that caused the crash.

System setup:
 Windows XP Pro, SP2
 Apache/2.0.50 (Win32) (Win32 bin files downloaded)
 PHP/5.0.2, extension INTERBASE used in php.ini
 Interbase 7 (WI-V7.1.0.131), TCP/IP connection (Localhost)
 No Zend optimizer

Note:
 If a value of 0 (zero) is given in the statement, then all works as expected.

Reproduce code:
---------------
1) Create the table "testtable" in a database with one field named "DTField" of type TIMESTAMP.

2) Execute the following code:
   // Crash Code
   $db = ibase_connect('','','','None',0,3);
   $sql = "INSERT INTO TestTable (DTField) VALUES (?)";
   $sth = ibase_query($db_intra, $sql, -1);
   ibase_commit($db);


Expected result:
----------------
The table should have a new entry

Actual result:
--------------
Apache crashes (php_interbase.dll)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-23 21:28 UTC] abies@php.net
Did you build php_interbase.dll from source, or did you use the pre-built one from php.net?
 [2005-02-24 09:10 UTC] sandell at slobtrot dot com
The PHP installation was not altered. It's the original PHP 5.0.2 installation (binary only).
 [2005-02-24 10:12 UTC] abies@php.net
Please try if the error can be reproduced with a php_interbase.dll built from source using the ibase.h header file that comes with Interbase 7.1


 [2005-02-24 10:20 UTC] sandell at winwap dot com
Compiling stuff is out of scope for me, sorry. The compiling must be done by someone else who knows how to do it.
 [2005-02-28 21:22 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-01 09:01 UTC] sandell at winwap dot com
The new Snapshot (downloaded 1.3.2005) still causes Apache to crash.

Tested with:
- Interbase Server v7.1 (WI-V7.1.0.192).
- Apache 2.0.50
- PHP 5.1.0-DEV
 [2007-10-23 17:21 UTC] Lars dot Westermann at privat dot dk
This bug is in fact the same as #32143

Look at the first param to ibase_query(). This is *not* the resource returned from ibase_connect().

The empty parameter is then passed as an empty querystring (as it is not a resource, it is treated as a (query)string). This empty querystring crashes IBserver 7 (but not Firebird 2).

A possible bugfix is suggested, and hopefully a bugfix is on it's way (in PHP 5.3).
 [2007-11-08 19:48 UTC] lwe@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in HEAD and PHP_5_3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC