]> granicus.if.org Git - php/commitdiff
Fix segv when einfo->errcode is not available.
authorMagnus M��tt� <magnus@php.net>
Wed, 9 Mar 2005 01:56:43 +0000 (01:56 +0000)
committerMagnus M��tt� <magnus@php.net>
Wed, 9 Mar 2005 01:56:43 +0000 (01:56 +0000)
Add missing NULL entry to oci_methods.

ext/pdo_oci/oci_driver.c

index e6608c341ab3748649d06ca11ffad132f03c538d..3e843c260f0ee4fc3d8340ab93a96d3ae6fa8308 100755 (executable)
@@ -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) /* {{{ */