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

index e0dfb652d9693d9814ab6bb447a202e5d18cbbf6..e9036178ddd775e243d39b597c4583ff2bc654ca 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_docref(NULL TSRMLS_CC, E_WARNING, "Trying to commit or rollback an already handled transaction");
                RETURN_FALSE;