summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2004-02-05 08:29:16 +0000
committerAntony Dovgal <tony2001@php.net>2004-02-05 08:29:16 +0000
commitd3cd05c95ad3b39c174488f82aebb2f572f8b7b7 (patch)
tree9e62bc50a7954fd81298433dab9686f530d9afff /ext/oci8/oci8.c
parent5b0c9335d3ff7cfcf1c3ebe01709709dc59a819e (diff)
downloadphp-git-d3cd05c95ad3b39c174488f82aebb2f572f8b7b7.tar.gz
fix bug #27149
(offset should start with 1)
Diffstat (limited to 'ext/oci8/oci8.c')
-rw-r--r--ext/oci8/oci8.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index afe70092ef..2a66ad88c9 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -3841,11 +3841,11 @@ PHP_FUNCTION(oci_lob_save)
if (offparam == -1) {
offset = curloblen;
- } else if (offparam >= curloblen) {
+ } else if ((ub4)offparam >= curloblen) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is bigger than current LOB-Size - appending");
offset = curloblen;
} else {
- offset = offparam;
+ offset = (ub4)offparam;
}
} else if (zend_get_parameters_ex(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -3859,6 +3859,10 @@ PHP_FUNCTION(oci_lob_save)
RETURN_FALSE;
}
+ if (offset <= 0) {
+ offset = 1;
+ }
+
CALL_OCI_RETURN(connection->error,
OCILobWrite(
connection->pServiceContext,