summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-01-20 11:01:36 +0000
committerAntony Dovgal <tony2001@php.net>2006-01-20 11:01:36 +0000
commitf14d1152fe9dc01ab602af49c25ea8de5662e655 (patch)
treedf15494d0283914fcba0451f17045fa72fe812b8
parent9b674c8a797add96397a50d5ca578a9cc67b6116 (diff)
downloadphp-git-f14d1152fe9dc01ab602af49c25ea8de5662e655.tar.gz
fix #36096 (oci_result() returns garbage after oci_fetch() failed)
-rw-r--r--ext/oci8/oci8_statement.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index 397b1924d0..d2d3aab744 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -165,7 +165,6 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* this is exactly what we requested */
return 0;
}
-
return 1;
}
@@ -509,7 +508,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
outcol->storage_size4 *= 3;
dynamic = OCI_DEFAULT;
- buf = outcol->data = (text *) emalloc(outcol->storage_size4);
+ buf = outcol->data = (text *) ecalloc(1, outcol->storage_size4);
break;
}
@@ -1020,6 +1019,10 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
if (!statement) {
return NULL;
}
+
+ if (!statement->has_data) {
+ return NULL;
+ }
if (Z_TYPE_P(column_index) == IS_STRING) {
column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC);