summaryrefslogtreecommitdiff
path: root/ext/pdo_oci/oci_driver.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-26 15:32:18 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-06-05 14:25:07 +0200
commita31f46421d7bf6f55dd9ac5876b8e2eacf7e0708 (patch)
tree24ffd7c5ae5e321c3994048fdd0fd9f68ae7457c /ext/pdo_oci/oci_driver.c
parent528aa7932a839fc6319979c34aa372805d8dc41c (diff)
downloadphp-git-a31f46421d7bf6f55dd9ac5876b8e2eacf7e0708.tar.gz
Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
Diffstat (limited to 'ext/pdo_oci/oci_driver.c')
-rw-r--r--ext/pdo_oci/oci_driver.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index 607069008d..f121b4791b 100644
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -461,6 +461,9 @@ static int oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /
{
#if (OCI_MAJOR_VERSION >= 10)
zend_string *action = zval_get_string(val);
+ if (EG(exception)) {
+ return 0;
+ }
H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION,
(dvoid *) ZSTR_VAL(action), (ub4) ZSTR_LEN(action),
@@ -479,6 +482,9 @@ static int oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /
{
#if (OCI_MAJOR_VERSION >= 10)
zend_string *client_info = zval_get_string(val);
+ if (EG(exception)) {
+ return 0;
+ }
H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION,
(dvoid *) ZSTR_VAL(client_info), (ub4) ZSTR_LEN(client_info),
@@ -497,6 +503,9 @@ static int oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /
{
#if (OCI_MAJOR_VERSION >= 10)
zend_string *identifier = zval_get_string(val);
+ if (EG(exception)) {
+ return 0;
+ }
H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION,
(dvoid *) ZSTR_VAL(identifier), (ub4) ZSTR_LEN(identifier),
@@ -515,6 +524,9 @@ static int oci_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /
{
#if (OCI_MAJOR_VERSION >= 10)
zend_string *module = zval_get_string(val);
+ if (EG(exception)) {
+ return 0;
+ }
H->last_err = OCIAttrSet(H->session, OCI_HTYPE_SESSION,
(dvoid *) ZSTR_VAL(module), (ub4) ZSTR_LEN(module),