summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2001-02-18 11:10:30 +0000
committerThies C. Arntzen <thies@php.net>2001-02-18 11:10:30 +0000
commit5f4090d0e05638a2ebaed080c3dcf66bf74bd544 (patch)
tree9b83313a80a3972eaaefa6b438d545b8c5378be4 /ext
parent6bf8736737b0def5c1628c4485c3be037eae7b5b (diff)
downloadphp-git-5f4090d0e05638a2ebaed080c3dcf66bf74bd544.tar.gz
- Fixed crash in OCI8 when using unitialized LOBs. (Thies)
Diffstat (limited to 'ext')
-rw-r--r--ext/oci8/oci8.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 2ee8ef2636..616e0a7803 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1023,14 +1023,11 @@ _oci_make_zval(zval *value,oci_statement *statement,oci_out_column *column, char
return -1;
}
- oci_loadlob(statement->conn,descr,&buffer,&loblen);
-
- if (loblen >= 0) {
- ZVAL_STRINGL(value,buffer,loblen,0);
- } else {
- /* XXX is this an error? */
+ if (oci_loadlob(statement->conn,descr,&buffer,&loblen)) {
ZVAL_BOOL(value,0);
- }
+ } else {
+ ZVAL_STRINGL(value,buffer,loblen,0);
+ }
} else {
/* return the locator */
object_init_ex(value, oci_lob_class_entry_ptr);
@@ -1607,7 +1604,7 @@ oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,u
&readlen);
if (connection->error) {
- oci_error(connection->pError, "OCILobFileOpen",connection->error);
+ oci_error(connection->pError, "OCILobGetLength",connection->error);
oci_handle_error(connection, connection->error);
return -1;
}
@@ -2791,7 +2788,6 @@ PHP_FUNCTION(ocisavelobfile)
PHP_FUNCTION(ociloadlob)
{
zval *id;
- oci_connection *connection;
oci_descriptor *descr;
char *buffer;
int inx;
@@ -2802,11 +2798,7 @@ PHP_FUNCTION(ociloadlob)
RETURN_FALSE;
}
- connection = descr->conn;
-
- oci_loadlob(connection,descr,&buffer,&loblen);
-
- if (loblen >= 0) {
+ if (!oci_loadlob(descr->conn,descr,&buffer,&loblen)) {
RETURN_STRINGL(buffer,loblen,0);
}
}