|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60621 dba_close() does not check for errors
Submitted: 2011-12-29 05:07 UTC Modified: 2013-12-05 16:05 UTC
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: Assigned:
Status: Wont fix Package: DBM/DBA related
PHP Version: 5.3SVN-2011-12-29 (SVN) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-12-29 05:07 UTC]
Please make PHP_FUNCTION(dba_close) return true for success, and raise a warning and return false on failure, as per the usual PHP convention.

PHP_FUNCTION(dba_close) calls zend_list_delete(), which doesn't provide any way for the handlers to report errors either via php_error_docref() or by returning false to the caller.

Some handlers (such as CDB) write a large amount of data to disk on close, and so a disk full error can easily be encountered, e.g.

You could change the prototype for dba_handler.close and dba_close() to return int, and you could make PHP_FUNCTION(dba_close) call dba_close() directly before destroying the resource. dba_close() would need to be modified slightly to avoid dangling pointers.


add-fronk-support (last revision 2013-11-11 15:07 UTC by ladycuyik14 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-05 16:05 UTC]
-Status: Open +Status: Wont fix
 [2013-12-05 16:05 UTC]
Unfortunately, not every DB handler supports a status code on close.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 10:04:43 2023 UTC