Bug #71305 [NEW]: Crash when optional resource is omitted

From: Date: Thu, 07 Jan 2016 18:04:27 +0000
Subject: Bug #71305 [NEW]: Crash when optional resource is omitted
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198501@lists.php.net to get a copy of this message
From:             mikedeweese at hotmail dot com
Operating system: Windows 10 x64
PHP version:      7.0.2
Package:          InterBase related
Bug Type:         Bug
Bug description:Crash when optional resource is omitted

Description:
------------
Calling ibase_query without a database link identifier crashes PHP.

In PHP5 and according to the manual, if omitted, the last opened link is
assumed.  

functions ibase_trans and ibase_prepare also take an optional database
link id and will also crash if one is not given in php7.



Test script:
---------------
$db = ibase_connect("172.16.2.1:TESTDB", 'sysdba', 'masterkey');
$q = ibase_query("SELECT * FROM UTUSERS WHERE FUSERID = 'MJD'");
print "ok";

Expected result:
----------------
ok should print to the screen

Actual result:
--------------
A windows dialog with php icon. "CLI has stopped working.  A problem
caused the program to stop working correctly.  Please close the
program."

If I put $db as the first param, there is no crash and ok prints as
expected.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=71305&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71305&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71305&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71305&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71305&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71305&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71305&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71305&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71305&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71305&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71305&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71305&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71305&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71305&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71305&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71305&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71305&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71305&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71305&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71305&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71305&r=mysqlcfg



Thread (8 messages)

« previous php.bugs (#198501) next »