From: foobar Date: Sun, 16 Mar 2003 00:38:51 +0000 (+0000) Subject: MFH: - Fixed bug #22709 (crash within interbase when database unavailable) X-Git-Tag: php-4.3.2RC2~303 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=183f99038a68ba8ed5236c95758d457c77384aed;p=php MFH: - Fixed bug #22709 (crash within interbase when database unavailable) --- diff --git a/NEWS b/NEWS index 66fdf19765..2ff6372f76 100644 --- 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 diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 716f754e51..74412f13cc 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -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;