]> granicus.if.org Git - php/commitdiff
MFH: - Fixed bug #22709 (crash within interbase when database unavailable)
authorfoobar <sniper@php.net>
Sun, 16 Mar 2003 00:38:51 +0000 (00:38 +0000)
committerfoobar <sniper@php.net>
Sun, 16 Mar 2003 00:38:51 +0000 (00:38 +0000)
NEWS
ext/interbase/interbase.c

diff --git a/NEWS b/NEWS
index 66fdf1976525cbd6e8fb591469dbad8127b00bce..2ff6372f76e69fd0bee172e70e7a6bb41de59606 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ PHP 4                                                                      NEWS
 - Fixed a bug in GD's truecolor TTF handling. (Derick)
 - Fixed several 64-bit problems. (Dave)
 - Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe)
+- Fixed bug #22709 (Crash in interbase when database unavailable). (Vladimir Michl)
 - Fixed bug #22681 (Crash when reading from invalid file pointer). (Ilia)
 - Fixed bug #22616 (Wrong order of -lssl and -lcrypto with IMAP). (Jani)
 - Fixed bug #22613 (imagettfbox() does not add the kerning distance to the
index 716f754e51455f8bc4a7d25e3cdd6ffeefd4aa4c..74412f13cc642b501c5ba36ca3db994c5f230470 100644 (file)
@@ -1578,6 +1578,11 @@ static int _php_ibase_def_trans(ibase_db_link * ib_link, int trans_n)
 {
        TSRMLS_FETCH();
        
+       if (ib_link == NULL) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database link");
+               return FAILURE;
+       }
+
        if (trans_n == 0 && ib_link->trans[0] == NULL) { 
                if (isc_start_transaction(IB_STATUS, &ib_link->trans[0], 1, &ib_link->link, 0, NULL)) {
                        _php_ibase_error(TSRMLS_C);
@@ -1615,6 +1620,11 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit)
                        break;
        }
 
+       if (ib_link == NULL) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database link");
+               RETURN_FALSE;
+       }
+
        if (ib_link->trans[trans_n] == NULL) {
                php_error(E_WARNING, "Trying to commit or rollback an already handled transaction");
                RETURN_FALSE;