summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2010-04-16 20:36:40 (GMT)
committerChristopher Jones <sixd@php.net>2010-04-16 20:36:40 (GMT)
commit9cd79b40c580360effb3d1fbca9c2c739ffbd6f5 (patch)
tree942ff96ec1a2c7996ea98bdd539c2486ba7df043
parentb501570ab037a12f9fac93ed446a9ea359de40d8 (diff)
downloadphp-9cd79b40c580360effb3d1fbca9c2c739ffbd6f5.tar.gz
Fixed Bug #51577 (Uninitialized memory reference with oci_bind_array_by_name)
-rw-r--r--ext/oci8/oci8_statement.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index fa5d915..f7fda51 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -809,8 +809,16 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC)
int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
{
php_oci_bind *bind = (php_oci_bind *) data;
+
*(int *)result = 0;
+ if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
+ /* These checks are currently valid for oci_bind_by_name, not
+ * oci_bind_array_by_name. Also bind->type and
+ * bind->indicator are not used for oci_bind_array_by_name.
+ */
+ return 0;
+ }
switch (bind->type) {
case SQLT_NTY:
case SQLT_BFILEE:
@@ -850,9 +858,8 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
}
break;
}
-
- /* reset all bind stuff to a normal state..-. */
+ /* reset all bind stuff to a normal state..-. */
bind->indicator = 0;
return 0;