From 088972feee0303bec36e5011d88b8b98ed8b9ec8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Magnus=20M=EF=BF=BD=EF=BF=BDtt=EF=BF=BD?= Date: Wed, 9 Mar 2005 01:56:43 +0000 Subject: [PATCH] Fix segv when einfo->errcode is not available. Add missing NULL entry to oci_methods. --- ext/pdo_oci/oci_driver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) /* {{{ */ -- 2.40.0