From f261a8f571808563af3a2c2ba34695210b97d176 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 5 Feb 2004 08:30:17 +0000 Subject: [PATCH] MFH: fix bug #27149 --- ext/oci8/oci8.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 0cd2ea28ab..0717ec28da 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -3118,11 +3118,11 @@ PHP_FUNCTION(ocisavelob) 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; @@ -3136,6 +3136,10 @@ PHP_FUNCTION(ocisavelob) RETURN_FALSE; } + if (offset <= 0) { + offset = 1; + } + CALL_OCI_RETURN(connection->error, OCILobWrite( connection->pServiceContext, connection->pError, -- 2.50.1