Compare commits

..
Author SHA1 Message Date
Anatol Belski b5434275c9 Set versions 2017-09-26 09:38:59 +02:00
Anatol Belski eac0bf11e4 Fix test failure on 32-bit
(cherry picked from commit 7674b5e574)
2017-09-12 18:22:07 +02:00
Anatol Belski b26d33a885 update NEWS 2017-09-12 12:22:52 +02:00
Remi Collet 7305432d9a Fixed bug #75193 segfault in collator_convert_object_to_string
(cherry picked from commit b09497c0e2)
2017-09-12 12:21:51 +02:00
Anatol Belski dc253f3cf2 Set versions and date 2017-09-12 09:07:28 +02:00
49 changed files with 966 additions and 2909 deletions

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.11
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.10
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
+4
View File
@@ -15,8 +15,11 @@ ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
ext/zip/php_zip.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
sapi/continuity/capi.c ident
Zend/RFCs/002.txt ident
Zend/RFCs/003.txt ident
ext/exif/exif.c ident
@@ -29,6 +32,7 @@ UPGRADING.INTERNALS merge=NEWS
/ext/bz2/tests/with_strings.phpt -crlf
/ext/dom/tests/bug40836.phpt -crlf
/ext/dom/tests/domelement.phpt -crlf
/ext/ereg/tests/eregi_basic_002.phpt -crlf
/ext/iconv/tests/iconv004.phpt -crlf
/ext/iconv/tests/iconv_basic.phpt -crlf
/ext/iconv/tests/iconv_strpos.phpt -crlf
+2
View File
@@ -262,7 +262,9 @@ pear/phpize
pear/run-tests
pear/php-config
pear/scripts
sapi/apache/libphp7.module
sapi/apache2handler/libphp7.module
sapi/apache_hooks/libphp7.module
sapi/cgi/php-cgi
sapi/cgi/php-cgi.1
sapi/cli/php.1
+4 -4
View File
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
all: $(all_targets)
all: $(all_targets)
@echo
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@@ -112,13 +112,13 @@ test: all
clean:
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f php7.spec main/build-defs.h scripts/phpize
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
@@ -135,7 +135,7 @@ prof-gen:
prof-clean:
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+1 -43
View File
@@ -1,47 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 Oct 2017 PHP 7.0.25
- Core:
. Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
(Laruence)
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
request). (Nikita)
. Fixed bug #75220 (Segfault when calling is_callable on parent).
(andrewnester)
. Fixed bug #75290 (debug info of Closures of internal functions contain
garbage argument names). (Andrea)
- Apache2Handler:
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
apache2handler). (mcarbonneaux)
- Date:
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
- Intl:
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
optional). (cmb)
- mcrypt:
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
- OCI8:
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
- PCRE:
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
- litespeed:
. Fixed bug #75248 (Binary directory doesn't get created when building
only litespeed SAPI). (petk)
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
- SPL:
. Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
(J. Jeising, cmb)
28 Sep 2017 PHP 7.0.24
- Core:
@@ -70,7 +28,7 @@ PHP NEWS
- Intl:
. Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
class). (tpunt)
. Fixed bug #75193 (segfault in collator_convert_object_to_string). (Remi)
. Fixed bug #75193 (segfault in collator_convert_object_to_string). (Remi)
- PDO_OCI:
. Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized
-13
View File
@@ -1,13 +0,0 @@
--TEST--
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
--FILE--
<?php
function eh(){}
set_error_handler('eh');
$d->d = &$d + $d->d/=0;
var_dump($d);
?>
--EXPECT--
float(INF)
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #75252: Incorrect token formatting on two parse errors in one request
--FILE--
<?php
$code = <<<'CODE'
function test_missing_semicolon() : string {
$x = []
FOO
}
CODE;
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
?>
--EXPECT--
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
--FILE--
<?php
var_dump((new ReflectionFunction('sin'))->getClosure());
var_dump(function ($someThing) {});
?>
--EXPECT--
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$number"]=>
string(10) "<required>"
}
}
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$someThing"]=>
string(10) "<required>"
}
}
-2
View File
@@ -896,8 +896,6 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
/* this should be compatible with the standard zenderror */
ZEND_COLD void zenderror(const char *error) /* {{{ */
{
CG(parse_error) = 0;
if (EG(exception)) {
/* An exception was thrown in the lexer, don't throw another in the parser. */
return;
+1
View File
@@ -297,6 +297,7 @@ ZEND_COLD void zenderror(const char *error);
#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
extern ZEND_API zend_class_entry *zend_standard_class_def;
extern ZEND_API zend_utility_values zend_uv;
extern ZEND_API zval zval_used_for_init;
/* If DTrace is available and enabled */
extern ZEND_API zend_bool zend_dtrace_enabled;
+3 -6
View File
@@ -3067,8 +3067,7 @@ get_function_via_handler:
(!fcc->function_handler->common.scope ||
!instanceof_function(ce_org, fcc->function_handler->common.scope))) {
if (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3238,8 +3237,7 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3326,8 +3324,7 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
+3 -10
View File
@@ -414,7 +414,6 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
HashTable *debug_info;
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
*is_temp = 1;
@@ -447,15 +446,9 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zend_string *name;
zval info;
if (arg_info->name) {
if (zstr_args) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
((zend_internal_arg_info*)arg_info)->name);
}
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$param%d",
arg_info->pass_by_reference ? "&" : "",
+1 -3
View File
@@ -221,10 +221,8 @@ try_again:
if (Z_TYPE(holder) == IS_LONG) { \
if (op == result) { \
zval_ptr_dtor(op); \
ZVAL_LONG(op, Z_LVAL(holder)); \
} else { \
(op) = &(holder); \
} \
(op) = &(holder); \
} \
break; \
} \
+2 -4
View File
@@ -219,10 +219,8 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
+15 -15
View File
@@ -2692,21 +2692,21 @@ EOF
else
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
fi
CONFIGURE_ARGS="$clean_configure_args"
while test "X$CONFIGURE_ARGS" != "X";
do
if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"`
then
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"`
elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"`
then
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"`
CURRENT_ARG="'$CURRENT_ARG'"
else
break
fi
$as_echo "$CURRENT_ARG \\" >>$1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG"
for arg in $clean_configure_args; do
if test `expr -- $arg : "'.*"` = 0; then
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
continue;
fi
echo "'[$]arg' \\" >> $1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'"
else
if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then
continue;
fi
echo "[$]arg \\" >> $1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg"
fi
done
echo '"[$]@"' >> $1
chmod +x $1
+1 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=25
PHP_RELEASE_VERSION=24
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+804 -2391
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -917,8 +917,8 @@ isoweek = year4 "-"? "W" weekofyear;
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
firstdayof = 'first day of';
lastdayof = 'last day of';
backof = 'back of ' hour24 (space? meridian)?;
frontof = 'front of ' hour24 (space? meridian)?;
backof = 'back of ' hour24 space? meridian?;
frontof = 'front of ' hour24 space? meridian?;
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
+1 -36
View File
@@ -647,7 +647,6 @@ static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot);
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
@@ -2118,7 +2117,7 @@ static void date_register_classes(void) /* {{{ */
date_object_handlers_interval.read_property = date_interval_read_property;
date_object_handlers_interval.write_property = date_interval_write_property;
date_object_handlers_interval.get_properties = date_object_get_properties_interval;
date_object_handlers_interval.get_property_ptr_ptr = date_interval_get_property_ptr_ptr;
date_object_handlers_interval.get_property_ptr_ptr = NULL;
date_object_handlers_interval.get_gc = date_object_get_gc_interval;
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
@@ -4143,40 +4142,6 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
}
/* }}} */
/* {{{ date_interval_get_property_ptr_ptr */
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
zval tmp_member, *ret;
if (Z_TYPE_P(member) != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
cache_slot = NULL;
}
if(zend_binary_strcmp("y", sizeof("y") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("m", sizeof("m") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("d", sizeof("d") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
/* Fallback to read_property. */
ret = NULL;
} else {
ret = (zend_get_std_object_handlers())->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
zval_dtor(member);
}
return ret;
}
/* }}} */
/* {{{ proto DateInterval::__construct([string interval_spec])
Creates new DateInterval object.
+1 -1
View File
@@ -40,7 +40,7 @@ object(DateInterval)#%d (15) {
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(0)
int(9)
["have_special_relative"]=>
int(0)
}
@@ -1,16 +0,0 @@
--TEST--
Test DateInterval props with dimension handling
--FILE--
<?php
class Z extends DateInterval{}
$z = new Z('P2Y4DT6H8M');
$i = 0;
$z->prop[1]=10;
while ($i < 1026) {
$z->prop[$i] = $i;
$i++;
}
?>
==NOCRASH==
--EXPECT--
==NOCRASH==
+1 -1
View File
@@ -897,7 +897,7 @@ static PHP_METHOD(UConverter, getAvailable) {
/* }}} */
/* {{{ proto array UConverter::getAliases(string name) */
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 1)
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 0)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getAliases) {
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #75318 (The parameter of UConverter::getAliases() is not optional)
--SKIP--
<?php
if (!extension_loaded('intl')) die('skip intl extension is not available');
?>
--FILE--
<?php
$rm = new ReflectionMethod('UConverter', 'getAliases');
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(1)
===DONE===
+1 -1
View File
@@ -89,7 +89,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
php_stream_bucket_delref(bucket);
} else {
/* Stream cipher */
bucket = php_stream_bucket_make_writeable(bucket);
php_stream_bucket_make_writeable(bucket);
if (data->encrypt) {
mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
} else {
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Bug #72535 arcfour encryption stream filter crashes php
--SKIPIF--
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
--FILE--
<?php
$passphrase = 'My secret';
$plaintext = 'Secret secret secret data';
$iv = substr(md5('iv' . $passphrase, true), 0, 8);
$key = substr(md5('pass1' . $passphrase, true) .
md5('pass2' . $passphrase, true), 0, 24);
$opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
$expected = substr($plaintext . $plaintext, 0, 48);
$fp = fopen('php://memory', 'wb+');
stream_filter_append($fp, 'mcrypt.arcfour', STREAM_FILTER_WRITE, $opts);
fwrite($fp, $plaintext);
?>
==NOCRASH==
--EXPECT--
==NOCRASH==
+4 -6
View File
@@ -1402,8 +1402,6 @@ void php_oci_define_hash_dtor(zval *data)
define->name = NULL;
}
zval_ptr_dtor(&define->val);
efree(define);
}
/* }}} */
@@ -1416,9 +1414,9 @@ void php_oci_bind_hash_dtor(zval *data)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
if (!Z_ISUNDEF(bind->val)) {
zval_ptr_dtor(&bind->val);
ZVAL_UNDEF(&bind->val);
if (!Z_ISUNDEF(bind->parameter)) {
zval_ptr_dtor(&bind->parameter);
ZVAL_UNDEF(&bind->parameter);
}
if (bind->array.elements) {
@@ -2644,7 +2642,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (placeholder == NULL) {
placeholder = return_value;
} else {
zval_ptr_dtor(placeholder);
zval_dtor(placeholder);
}
array_init(placeholder);
+4 -4
View File
@@ -75,10 +75,10 @@ sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_even
ZVAL_NULL(&params[0]);
/* Cleanup */
zval_ptr_dtor(&retval);
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&params[1]);
zval_ptr_dtor(&params[2]);
zval_dtor(&retval);
zval_dtor(&params[0]);
zval_dtor(&params[1]);
zval_dtor(&params[2]);
return returnValue;
}
+4 -5
View File
@@ -117,7 +117,7 @@ PHP_FUNCTION(oci_define_by_name)
php_oci_define *define;
zend_string *zvtmp;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
return;
}
@@ -153,8 +153,7 @@ PHP_FUNCTION(oci_define_by_name)
define->name[name_len] = '\0';
define->name_len = (ub4) name_len;
define->type = (ub4) type;
ZEND_ASSERT(Z_ISREF_P(var));
ZVAL_COPY(&define->val, var);
define->zval = var;
RETURN_TRUE;
}
@@ -203,7 +202,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rszl|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
return;
}
@@ -1440,7 +1439,7 @@ PHP_FUNCTION(oci_fetch_all)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
zval_ptr_dtor(array);
zval_dtor(array);
while (skip--) {
if (php_oci_statement_fetch(statement, nrows)) {
+66 -85
View File
@@ -364,10 +364,8 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
continue;
}
ZEND_ASSERT(Z_ISREF(column->define->val));
zval_ptr_dtor(Z_REFVAL(column->define->val));
ZVAL_NULL(Z_REFVAL(column->define->val));
php_oci_column_to_zval(column, Z_REFVAL(column->define->val), 0);
zval_dtor(column->define->zval);
php_oci_column_to_zval(column, column->define->zval, 0);
}
return 0;
@@ -912,12 +910,10 @@ void php_oci_statement_free(php_oci_statement *statement)
int php_oci_bind_pre_exec(zval *data, void *result)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
zval *zv = &bind->val;
*(int *)result = 0;
ZVAL_DEREF(zv);
if (Z_TYPE_P(zv) == IS_ARRAY) {
if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
/* These checks are currently valid for oci_bind_by_name, not
* oci_bind_array_by_name. Also bind->type and
* bind->indicator are not used for oci_bind_array_by_name.
@@ -931,7 +927,7 @@ int php_oci_bind_pre_exec(zval *data, void *result)
case SQLT_CLOB:
case SQLT_BLOB:
case SQLT_RDD:
if (Z_TYPE_P(zv) != IS_OBJECT) {
if (Z_TYPE_P(bind->zval) != IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -947,14 +943,14 @@ int php_oci_bind_pre_exec(zval *data, void *result)
case SQLT_LBI:
case SQLT_BIN:
case SQLT_LNG:
if (Z_TYPE_P(zv) == IS_RESOURCE || Z_TYPE_P(zv) == IS_OBJECT) {
if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
case SQLT_RSET:
if (Z_TYPE_P(zv) != IS_RESOURCE) {
if (Z_TYPE_P(bind->zval) != IS_RESOURCE) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -975,34 +971,30 @@ int php_oci_bind_post_exec(zval *data)
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
php_oci_connection *connection = bind->parent_statement->connection;
sword errstatus;
zval *zv = &bind->val;
ZVAL_DEREF(zv);
if (bind->indicator == -1) { /* NULL */
if (Z_TYPE_P(zv) == IS_STRING) {
*Z_STRVAL_P(zv) = '\0'; /* XXX avoid warning in debug mode */
zval *val = bind->zval;
if (Z_TYPE_P(val) == IS_STRING) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
}
zval_ptr_dtor(zv);
ZVAL_NULL(zv);
} else if (Z_TYPE_P(zv) == IS_STRING
&& Z_STRLEN_P(zv) > 0
&& Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] != '\0') {
zval_dtor(val);
ZVAL_NULL(val);
} else if (Z_TYPE_P(bind->zval) == IS_STRING
&& Z_STRLEN_P(bind->zval) > 0
&& Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
/* The post- PHP 5.3 feature for "interned" strings disallows
* their reallocation but (i) any IN binds either interned or
* not should already be null terminated and (ii) for OUT
* binds, php_oci_bind_out_callback() should have allocated a
* new string that we can modify here.
*/
SEPARATE_STRING(zv);
Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0);
Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0';
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
Z_STR_P(bind->zval) = zend_string_extend(Z_STR_P(bind->zval), Z_STRLEN_P(bind->zval)+1, 0);
Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
} else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
int i;
zval *entry = NULL;
HashTable *hash;
SEPARATE_ARRAY(zv);
hash = HASH_OF(zv);
HashTable *hash = HASH_OF(bind->zval);
zend_hash_internal_pointer_reset(hash);
switch (bind->array.type) {
@@ -1011,22 +1003,22 @@ int php_oci_bind_post_exec(zval *data)
case SQLT_LNG:
for (i = 0; i < (int) bind->array.current_length; i++) {
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_ptr_dtor(entry);
zval_dtor(entry);
ZVAL_LONG(entry, ((oci_phpsized_int *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_long(zv, ((oci_phpsized_int *)(bind->array.elements))[i]);
add_next_index_long(bind->zval, ((oci_phpsized_int *)(bind->array.elements))[i]);
}
}
break;
case SQLT_FLT:
for (i = 0; i < (int) bind->array.current_length; i++) {
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_ptr_dtor(entry);
zval_dtor(entry);
ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_double(zv, ((double *)(bind->array.elements))[i]);
add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
}
}
break;
@@ -1039,7 +1031,7 @@ int php_oci_bind_post_exec(zval *data)
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
zval_ptr_dtor(entry);
zval_dtor(entry);
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
@@ -1055,10 +1047,10 @@ int php_oci_bind_post_exec(zval *data)
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
add_next_index_null(zv);
add_next_index_null(bind->zval);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
add_next_index_stringl(zv, (char *)buff, buff_len);
add_next_index_stringl(bind->zval, (char *)buff, buff_len);
}
}
}
@@ -1074,21 +1066,20 @@ int php_oci_bind_post_exec(zval *data)
/* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
int curr_element_length = bind->array.element_lengths[i];
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_ptr_dtor(entry);
zval_dtor(entry);
ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
zend_hash_move_forward(hash);
} else {
add_next_index_stringl(zv, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
}
}
break;
}
} else if ((Z_TYPE_P(zv) == IS_TRUE) || (Z_TYPE_P(zv) == IS_FALSE)) {
/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temorary value) */
if (Z_LVAL_P(zv) == 0)
ZVAL_BOOL(zv, FALSE);
else if (Z_LVAL_P(zv) == 1)
ZVAL_BOOL(zv, TRUE);
} else if ((Z_TYPE_P(bind->zval) == IS_TRUE) || (Z_TYPE_P(bind->zval) == IS_FALSE)) {
if (Z_LVAL_P(bind->zval) == 0)
ZVAL_BOOL(bind->zval, FALSE);
else if (Z_LVAL_P(bind->zval) == 1)
ZVAL_BOOL(bind->zval, TRUE);
}
return 0;
@@ -1112,8 +1103,11 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
sword errstatus;
zval *param = NULL;
ZEND_ASSERT(Z_ISREF_P(var));
param = Z_REFVAL_P(var);
if (!Z_ISREF_P(var)) {
param = var;
} else {
param = Z_REFVAL_P(var);
}
switch (type) {
case SQLT_NTY:
@@ -1248,9 +1242,9 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) {
bindp = old_bind;
if (!Z_ISUNDEF(bindp->val)) {
zval_ptr_dtor(&bindp->val);
ZVAL_UNDEF(&bindp->val);
if (!Z_ISUNDEF(bindp->parameter)) {
zval_ptr_dtor(&bindp->parameter);
ZVAL_UNDEF(&bindp->parameter);
}
} else {
zend_string *zvtmp;
@@ -1260,6 +1254,9 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
zend_string_release(zvtmp);
}
/* Keep a copy of bound variable in the bind hash */
ZVAL_COPY(&bindp->parameter, var);
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
* when both in/out parameters are bound with empty strings
*/
@@ -1269,7 +1266,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
bindp->descriptor = oci_desc;
bindp->statement = oci_stmt;
bindp->parent_statement = statement;
ZVAL_COPY(&bindp->val, var);
bindp->zval = param;
bindp->type = type;
/* Storing max length set in OCIBindByName() to check it later in
* php_oci_bind_in_callback() function to avoid ORA-1406 error while
@@ -1363,14 +1360,11 @@ sb4 php_oci_bind_in_callback(
php_oci_bind *phpbind;
zval *val;
if (!(phpbind=(php_oci_bind *)ictxp) || Z_ISUNDEF(phpbind->val)) {
if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) {
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return OCI_ERROR;
}
val = &phpbind->val;
ZVAL_DEREF(val);
if (Z_ISNULL_P(val)) {
/* we're going to insert a NULL column */
phpbind->indicator = -1;
@@ -1427,14 +1421,11 @@ sb4 php_oci_bind_out_callback(
zval *val;
sb4 retval = OCI_ERROR;
if (!(phpbind=(php_oci_bind *)octxp) || Z_ISUNDEF(phpbind->val)) {
if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) {
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return retval;
}
val = &phpbind->val;
ZVAL_DEREF(val);
if (Z_TYPE_P(val) == IS_RESOURCE) {
/* Processing for ref-cursor out binds */
if (phpbind->statement != NULL) {
@@ -1472,7 +1463,7 @@ sb4 php_oci_bind_out_callback(
retval = OCI_CONTINUE;
} else {
convert_to_string(val);
zval_ptr_dtor(val);
zval_dtor(val);
{
char *p = ecalloc(1, PHP_OCI_PIECE_SIZE);
@@ -1483,12 +1474,12 @@ sb4 php_oci_bind_out_callback(
Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(val) + 1);
/* XXX is this right? */
ZVAL_STRINGL(val, NULL, Z_STRLEN(val) + 1);
ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1);
#endif
/* XXX we assume that zend-zval len has 4 bytes */
*alenpp = (ub4*) &Z_STRLEN_P(val);
*bufpp = Z_STRVAL_P(val);
*alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
*bufpp = Z_STRVAL_P(phpbind->zval);
*piecep = OCI_ONE_PIECE;
*rcodepp = &phpbind->retcode;
*indpp = &phpbind->indicator;
@@ -1536,10 +1527,10 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
if (!column) {
php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", Z_LVAL(tmp));
zval_ptr_dtor(&tmp);
zval_dtor(&tmp);
return NULL;
}
zval_ptr_dtor(&tmp);
zval_dtor(&tmp);
}
return column;
}
@@ -1595,15 +1586,11 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows)
Bind arrays to PL/SQL types */
int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type)
{
php_oci_bind *bind;
php_oci_bind *bind, *bindp;
sword errstatus;
zend_string *zvtmp;
zval *val;
ZEND_ASSERT(Z_ISREF_P(var));
val = Z_REFVAL_P(var);
SEPARATE_ZVAL_NOREF(val);
convert_to_array(val);
convert_to_array(var);
if (maxlength < -1) {
php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength);
@@ -1614,11 +1601,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
case SQLT_NUM:
case SQLT_INT:
case SQLT_LNG:
bind = php_oci_bind_array_helper_number(val, max_table_length);
bind = php_oci_bind_array_helper_number(var, max_table_length);
break;
case SQLT_FLT:
bind = php_oci_bind_array_helper_double(val, max_table_length);
bind = php_oci_bind_array_helper_double(var, max_table_length);
break;
case SQLT_AFC:
@@ -1627,14 +1614,14 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
case SQLT_AVC:
case SQLT_STR:
case SQLT_LVC:
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(val)) == 0) {
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) {
php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays");
return 1;
}
bind = php_oci_bind_array_helper_string(val, max_table_length, maxlength);
bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength);
break;
case SQLT_ODT:
bind = php_oci_bind_array_helper_date(val, max_table_length, statement->connection);
bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: " ZEND_LONG_FMT, type);
@@ -1651,7 +1638,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
bind->statement = NULL;
bind->parent_statement = statement;
bind->bind = NULL;
ZVAL_COPY(&bind->val, var);
bind->zval = var;
bind->array.type = type;
bind->indicator = 0; /* not used for array binds */
bind->type = 0; /* not used for array binds */
@@ -1690,8 +1677,6 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
efree(bind->array.indicators);
}
zval_ptr_dtor(&bind->val);
efree(bind);
statement->errcode = php_oci_error(statement->err, errstatus);
@@ -1705,7 +1690,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
}
zvtmp = zend_string_init(name, name_len, 0);
zend_hash_update_ptr(statement->binds, zvtmp, bind);
bindp = zend_hash_update_ptr(statement->binds, zvtmp, bind);
zend_string_release(zvtmp);
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
@@ -1722,7 +1707,6 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
if (maxlength == -1) {
@@ -1739,7 +1723,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
}
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->val);
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
@@ -1796,11 +1780,10 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->val);
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (oci_phpsized_int *)safe_emalloc(max_table_length, sizeof(oci_phpsized_int), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1837,11 +1820,10 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->val);
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1879,11 +1861,10 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
zval *entry;
sword errstatus;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->val);
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
+1 -1
View File
@@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.8"
#define PHP_OCI8_VERSION "2.1.7"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
+3 -2
View File
@@ -209,7 +209,7 @@ typedef struct {
/* {{{ php_oci_define */
typedef struct {
zval val; /* zval used in define */
zval *zval; /* zval used in define */
text *name; /* placeholder's name */
ub4 name_len; /* placeholder's name length */
ub4 type; /* define type */
@@ -244,7 +244,8 @@ typedef struct {
/* {{{ php_oci_bind */
typedef struct {
OCIBind *bind; /* bind handle */
zval val; /* value */
zval *zval; /* value */
zval parameter; /* a copy of bound variable used for oci_bind_by_name */
dvoid *descriptor; /* used for binding of LOBS etc */
OCIStmt *statement; /* used for binding REFCURSORs */
php_oci_statement *parent_statement; /* pointer to the parent statement */
+1 -6
View File
@@ -7272,12 +7272,7 @@ for (;; ptr++)
so far in order to get the number. If the name is not found, leave
the value of recno as 0 for a forward reference. */
/* This patch (removing "else") fixes a problem when a reference is
to multiple identically named nested groups from within the nest.
Once again, it is not the "proper" fix, and it results in an
over-allocation of memory. */
/* else */
else
{
ng = cd->named_groups;
for (i = 0; i < cd->names_found; i++, ng++)
-10
View File
@@ -1,10 +0,0 @@
--TEST--
CVE-2016-1283, see bug #75207
--FILE--
<?php
preg_match("/š(?:F?+(?:^(?(R)a+\"){99}-))(?J)(?'R'(?'R'<((?'RR'(?'R'\){97)?J)?J)(?'R'(?'R'\){99|(:(?|(?'R')(\k'R')|((?'R')))H'R'R)(H'R))))))/", "*b\dc");
?>
==DONE==
--EXPECTF--
Warning: preg_match(): Compilation failed: unmatched parentheses at offset %d in %s on line %d
==DONE==
-1
View File
@@ -3,7 +3,6 @@ Bug #74950 (null pointer deref in zim_simplexml_element_getDocNamespaces)
--SKIPIF--
<?php
if (!extension_loaded("simplexml")) die("skip SimpleXML not available");
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
?>
--FILE--
<?php
+1 -1
View File
@@ -733,7 +733,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
return;
}
intern->flags = (value & SPL_DLLIST_IT_MASK) | (intern->flags & SPL_DLLIST_IT_FIX);
intern->flags = value & SPL_DLLIST_IT_MASK;
RETURN_LONG(intern->flags);
}
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
--FILE--
<?php
$q = new SplQueue();
try {
$q->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
} catch (Exception $e) {
echo 'unexpected exception: ' . $e->getMessage() . "\n";
}
try {
$q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);
} catch (Exception $e) {
echo 'expected exception: ' . $e->getMessage() . "\n";
}
?>
===DONE===
--EXPECTF--
expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen
===DONE===
+1 -1
View File
@@ -314,7 +314,7 @@ PHP_FUNCTION(stream_socket_get_name)
RETURN_FALSE;
}
if ((ZSTR_LEN(name) == 0) || (ZSTR_VAL(name)[0] == 0)) {
if (!ZSTR_LEN(name)) {
zend_string_release(name);
RETURN_FALSE;
}
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #75220 (is_callable crash for 'parent')
--FILE--
<?php
$a = new A();
$a->bar('foo');
class B {};
class A extends B
{
function bar($func)
{
var_dump('foo');
var_dump(is_callable('parent::foo'));
var_dump(is_callable(array('parent', 'foo')));
}
function __call($func, $args)
{
}
};
?>
--EXPECT--
string(3) "foo"
bool(false)
bool(false)
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #75055 Out-Of-Bounds Read in timelib_meridian()
--SKIPIF--
<?php if (!extension_loaded("wddx")) print "skip"; ?>
--FILE--
<?php
$file_str = dirname(__FILE__) . "/bug75055.wddx";
$wddx_str = file_get_contents($file_str);
print strlen($wddx_str) . " bytes read.\n";
var_dump(wddx_deserialize($wddx_str));
?>
--EXPECT--
323 bytes read.
array(1) {
["aDateTime"]=>
string(12) "frONt of 0 0"
}
-13
View File
@@ -1,13 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd'>
<wddxPacket version='1.0'>
<header/>
<data>
<struct>
<var name='aDateTime'>
<dateTime>frONt of 0 0</dateTime>
</var>
</struct>
</data>
</wddxPacket>
+7 -32
View File
@@ -92,8 +92,6 @@
#include "SAPI.h"
#include "rfc1867.h"
#include "ext/standard/html_tables.h"
#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
@@ -126,31 +124,6 @@ PHPAPI int core_globals_id;
#define SAFE_FILENAME(f) ((f)?(f):"-")
static char *get_safe_charset_hint(void) {
ZEND_TLS char *lastHint = NULL;
ZEND_TLS char *lastCodeset = NULL;
char *hint = SG(default_charset);
size_t len = strlen(hint);
size_t i = 0;
if (lastHint == SG(default_charset)) {
return lastCodeset;
}
lastHint = hint;
lastCodeset = NULL;
for (i = 0; i < sizeof(charset_map)/sizeof(charset_map[0]); i++) {
if (len == charset_map[i].codeset_len
&& zend_binary_strcasecmp(hint, len, charset_map[i].codeset, len) == 0) {
lastCodeset = (char*)charset_map[i].codeset;
break;
}
}
return lastCodeset;
}
/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnSetPrecision)
@@ -749,10 +722,10 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
buffer_len = (int)vspprintf(&buffer, 0, format, args);
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, get_safe_charset_hint());
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, SG(default_charset));
/* Retry with substituting invalid chars on fail. */
if (!replace_buffer || ZSTR_LEN(replace_buffer) < 1) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, get_safe_charset_hint());
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, SG(default_charset));
}
efree(buffer);
@@ -819,7 +792,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
}
if (PG(html_errors)) {
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, get_safe_charset_hint());
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, SG(default_charset));
efree(origin);
origin = ZSTR_VAL(replace_origin);
}
@@ -1133,7 +1106,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
if (PG(html_errors)) {
if (type == E_ERROR || type == E_PARSE) {
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, get_safe_charset_hint());
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, SG(default_charset));
php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, ZSTR_VAL(buf), error_filename, error_lineno, STR_PRINT(append_string));
zend_string_free(buf);
} else {
@@ -1200,7 +1173,9 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
}
/* the parser would return 1 (failure), we can bail out nicely */
if (type != E_PARSE) {
if (type == E_PARSE) {
CG(parse_error) = 0;
} else {
/* restore memory limit */
zend_set_memory_limit(PG(memory_limit));
efree(buffer);
+3 -3
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 0
#define PHP_RELEASE_VERSION 25
#define PHP_RELEASE_VERSION 24
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.0.25"
#define PHP_VERSION_ID 70025
#define PHP_VERSION "7.0.24"
#define PHP_VERSION_ID 70024
+2 -2
View File
@@ -128,7 +128,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, zval *zv,
if (new_per_dir_entry->status >= orig_per_dir_entry->status) {
/* use new entry */
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", ZSTR_VAL(hash_key->key), new_per_dir_entry->status, orig_per_dir_entry->status));
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", hash_key->arKey, new_per_dir_entry->status, orig_per_dir_entry->status));
return 1;
} else {
return 0;
@@ -176,7 +176,7 @@ void apply_config(void *dummy)
php_dir_entry *data;
ZEND_HASH_FOREACH_STR_KEY_PTR(&d->config, str, data) {
phpapdebug((stderr, "APPLYING (%s)(%s)\n", ZSTR_VAL(str), data->value));
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
if (zend_alter_ini_entry_chars(str, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
+3 -3
View File
@@ -27,9 +27,9 @@ if test "$PHP_CGI" != "no"; then
AC_MSG_CHECKING([whether cross-process locking is required by accept()])
case "`uname -sr`" in
IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
AC_MSG_RESULT([yes])
AC_DEFINE([USE_LOCKING], [1],
AC_DEFINE([USE_LOCKING], [1],
[Define if cross-process locking is required by accept()])
;;
*)
@@ -74,5 +74,5 @@ if test "$PHP_CGI" != "no"; then
PHP_OUTPUT(sapi/cgi/php-cgi.1)
else
AC_MSG_RESULT(no)
AC_MSG_RESULT(yes)
fi
+13 -1
View File
@@ -20,7 +20,19 @@ if (shell_exec('PowerShell -Help') === NULL)
// Hence on Windows 8, we don't verify that the title is actually set by
// cli_set_process_title(). We're only making the API calls to ensure there are
// no warnings/errors.
$is_windows8_or_above = PHP_WINDOWS_VERSION_MAJOR >= 10 || PHP_WINDOWS_VERSION_MAJOR >= 6 && PHP_WINDOWS_VERSION_MINOR >= 2;
$is_windows8_or_above = false;
$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\"");
if ($ps_output === null)
{
echo "Get-Host failed\n";
die();
}
$ps_output = trim($ps_output);
$end_title_windows8 = ": Windows PowerShell";
if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8) || PHP_WINDOWS_VERSION_MAJOR >= 10)
$is_windows8_or_above = true;
echo "*** Testing setting the process title ***\n";
+1 -1
View File
@@ -4,7 +4,7 @@
$Id$
(c) 2011 Jerome Loyet
The PHP License, version 3.01
This is sample real-time status page for FPM. You can change it to better fit your needs.
This is sample real-time status page for FPM. You can change it to better feet your needs.
-->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+2 -2
View File
@@ -5,5 +5,5 @@ $(SAPI_LITESPEED_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_LITESPEED_OB
install-litespeed: $(SAPI_LITESPEED_PATH)
@echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #75236: infinite loop when printing an error-message
--FILE--
<?php
ini_set('html_errors', true);
ini_set('default_charset', 'ISO-8859-2');
printf ("before getfilecontent\n");
file_get_contents ('no/suchfile');
printf ("after getfilecontent\n");
?>
--EXPECTF--
before getfilecontent
<br />
<b>Warning</b>: file_get_contents(no/suchfile): failed to open stream: No such file or directory in <b>%s</b> on line <b>7</b><br />
after getfilecontent
+2 -2
View File
@@ -11,6 +11,6 @@ libpng-1.6.29
libpq-9.6.2
libssh2-1.8.0
libtidy-20090406
libxslt-1.1.30
libxml-2.9.5
libxslt-1.1.29
libxml-2.9.4
openssl-1.0.2k