]> granicus.if.org Git - php/commitdiff
fix bug #27149
authorAntony Dovgal <tony2001@php.net>
Thu, 5 Feb 2004 08:29:16 +0000 (08:29 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 5 Feb 2004 08:29:16 +0000 (08:29 +0000)
(offset should start with 1)

ext/oci8/oci8.c

index afe70092ef1dc27c9756e2344ce6eaf296ec80e7..2a66ad88c93f7986156462e4d87c3fb9322ead96 100644 (file)
@@ -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,