-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #78473: odbc_close() closes arbitrary resources
We have to bail out, if an invalid resource is given. For consistency with the other `zend_fetch_resource(2)` calls, we return `FALSE`.
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Bug #78473 (odbc_close() closes arbitrary resources) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('odbc')) die('skip odbc extension not available'); | ||
?> | ||
--FILE-- | ||
<?php | ||
odbc_close(STDIN); | ||
var_dump(STDIN); | ||
?> | ||
--EXPECTF-- | ||
Warning: odbc_close(): supplied resource is not a valid ODBC-Link resource in %s on line %d | ||
resource(%d) of type (stream) |