- Fixed a possible arbitrary memory access inside sqlite extension. Reported
by Mateusz Kocielski. (Ilia)
+- Fixed bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with
+ constant array). (Felipe)
- Fixed bug #51671 (imagefill does not work correctly for small images).
(Pierre)
- Fixed bug #51670 (getColumnMeta causes segfault when re-executing query
*return_value = precv->op2.u.constant;
INIT_PZVAL(return_value);
- if (Z_TYPE_P(return_value) != IS_CONSTANT) {
+ if (Z_TYPE_P(return_value) != IS_CONSTANT && Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) {
zval_copy_ctor(return_value);
}
zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC);
--- /dev/null
+--TEST--
+Bug #51911 (ReflectionParameter::getDefaultValue() memory leaks with constant array)
+--FILE--
+<?php
+
+class Foo {
+ const X = 1;
+ public function x($x = array(1)) {}
+}
+
+$clazz = new ReflectionClass('Foo');
+$method = $clazz->getMethod('x');
+foreach ($method->getParameters() as $param) {
+ if ( $param->isDefaultValueAvailable())
+ echo '$', $param->getName(), ' : ', var_export($param->getDefaultValue(), 1), "\n";
+}
+
+?>
+--EXPECT--
+$x : array (
+ 0 => 1,
+)