From: Antony Dovgal Date: Wed, 21 Jan 2004 12:30:05 +0000 (+0000) Subject: fix potential segfault in oci_lob_write() X-Git-Tag: php_ibase_before_split~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c375c6807333492602d400e79c558d0098164bf8;p=php fix potential segfault in oci_lob_write() change oci_lob_trim() - truncate length should be 0 by default. --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index d9856ffc1e..bda502a5fd 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -2196,7 +2196,7 @@ static int oci_lobgetlen(oci_connection *connection, oci_descriptor *mydescr, ub } } - oci_debug("OCILobGetLen: len=%d",loblen); + oci_debug("OCILobGetLen: len=%d",*loblen); return 0; } @@ -4221,6 +4221,7 @@ PHP_FUNCTION(oci_lob_write) } if (zend_get_parameters_ex(2, &data, &length) == SUCCESS) { + convert_to_string_ex(data); convert_to_long_ex(length); write_length = Z_LVAL_PP(length); } else if (zend_get_parameters_ex(1, &data) == SUCCESS) { @@ -4389,7 +4390,7 @@ PHP_FUNCTION(oci_lob_truncate) convert_to_long_ex(length); trim_length = Z_LVAL_PP(length); } else { - WRONG_PARAM_COUNT; + trim_length = 0; } if (trim_length < 0) {