From: Magnus M��tt� Date: Wed, 9 Mar 2005 01:56:43 +0000 (+0000) Subject: Fix segv when einfo->errcode is not available. X-Git-Tag: RELEASE_0_3~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=088972feee0303bec36e5011d88b8b98ed8b9ec8;p=php Fix segv when einfo->errcode is not available. Add missing NULL entry to oci_methods. --- diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index e6608c341a..3e843c260f 100755 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -46,8 +46,10 @@ static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info } } - add_next_index_long(info, einfo->errcode); - add_next_index_string(info, einfo->errmsg, 1); + if (einfo->errcode) { + add_next_index_long(info, einfo->errcode); + add_next_index_string(info, einfo->errmsg, 1); + } return 1; } @@ -382,7 +384,8 @@ static struct pdo_dbh_methods oci_methods = { NULL, pdo_oci_fetch_error_func, NULL, /* get_attr */ - NULL /* check_liveness */ + NULL, /* check_liveness */ + NULL /* get_driver_methods */ }; static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */