summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8_statement.c
diff options
context:
space:
mode:
authorChristopher Jones <christopher.jones@oracle.com>2015-11-07 01:56:50 +1100
committerChristopher Jones <christopher.jones@oracle.com>2015-11-07 01:56:50 +1100
commit3060dfd92e0126e92b1501dba807bfcd44bef53a (patch)
treecd0fb1ea2818c7d7f57c4007afc49a88d9da32c1 /ext/oci8/oci8_statement.c
parent1c0622a472cb88f780733456f5bb0eb03a40a1cb (diff)
downloadphp-git-3060dfd92e0126e92b1501dba807bfcd44bef53a.tar.gz
Fix bug 68298 (PHP OCI8 OCI int overflow) (Senthil)
Diffstat (limited to 'ext/oci8/oci8_statement.c')
-rw-r--r--ext/oci8/oci8_statement.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index 4d18a916d8..ad30a65377 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -1139,15 +1139,22 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_INT:
case SQLT_NUM:
+ {
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_long(var);
+#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION > 10
+ bind_data = (ub8 *)&Z_LVAL_P(var);
+ value_sz = sizeof(ub8);
+#else
bind_data = (ub4 *)&Z_LVAL_P(var);
value_sz = sizeof(ub4);
+#endif
mode = OCI_DEFAULT;
- break;
+ }
+ break;
case SQLT_LBI:
case SQLT_BIN: