Compare commits

..
Author SHA1 Message Date
Christoph M. Becker a1457cf8b8 Update NEWS 2019-12-17 09:37:48 +01:00
Stanislav Malyshev b88bd529e7 Fix test
(cherry picked from commit a62154564d)
2019-12-17 09:33:37 +01:00
Stanislav Malyshev 3371c84ff1 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test
  Fix bug #78793

(cherry picked from commit 5cb4686753)
2019-12-17 09:33:21 +01:00
Stanislav Malyshev df5ec733ff Fix build - no model field anymore
(cherry picked from commit b74a300edf)
2019-12-17 09:33:05 +01:00
Stanislav Malyshev 63d0fa4a92 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78910
  Fix #78878: Buffer underflow in bc_shift_addsub
  Fix test
  Fix #78862: link() silently truncates after a null byte on Windows
  Fix #78863: DirectoryIterator class silently truncates after a null byte

(cherry picked from commit a65b8abf2c)
2019-12-17 09:32:47 +01:00
Christoph M. Becker 11893c8e66 Fix #78943: mail() may release string with refcount==1 twice
Since we need `headers_lc` as well as `headers_trim` in the following,
we do not release the former even if they are the same string, to avoid
complicating the release logic even more.

A new test case is not necessary, since we already have
mail_basic_alt2-win32.phpt and others.

(cherry picked from commit 518a160b65)
2019-12-17 09:32:28 +01:00
Christoph M. Becker 36ac1671d5 Update for 7.3.13 2019-12-17 09:29:20 +01:00
Christoph M. Becker 303528803a Prepare 7.3.13RC1 2019-12-03 12:15:54 +01:00
119 changed files with 227 additions and 2444 deletions

No files matched your search

+1 -120
View File
@@ -1,125 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 Feb 2020, PHP 7.3.15
- Core:
. Fixed bug #71876 (Memory corruption htmlspecialchars(): charset `*' not
supported). (Nikita)
. Fixed bug ##79146 (cscript can fail to run on some systems). (clarodeus)
. Fixed bug #78323 (Code 0 is returned on invalid options). (Ivan Mikheykin)
. Fixed bug #76047 (Use-after-free when accessing already destructed
backtrace arguments). (Nikita)
- CURL:
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).
(cmb)
-Intl:
. Fixed bug #79212 (NumberFormatter::format() may detect wrong type). (cmb)
- Libxml:
. Fixed bug #79191 (Error in SoapClient ctor disables DOMDocument::save()).
(Nikita, cmb)
- MBString:
. Fixed bug #79154 (mb_convert_encoding() can modify $from_encoding). (cmb)
- MySQLnd:
. Fixed bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH).
(cmb)
- OpenSSL:
. Fixed bug #79145 (openssl memory leak). (cmb, Nikita)
- Phar:
. Fixed bug #79082 (Files added to tar with Phar::buildFromIterator have
all-access permissions). (CVE-2020-7063) (stas)
. Fixed bug #79171 (heap-buffer-overflow in phar_extract_file).
(CVE- 2020-7061) (cmb)
. Fixed bug #76584 (PharFileInfo::decompress not working). (cmb)
- Reflection:
. Fixed bug #79115 (ReflectionClass::isCloneable call reflected class
__destruct). (Nikita)
- Session:
. Fixed bug #79221 (Null Pointer Dereference in PHP Session Upload Progress).
(CVE-2020-7062) (stas)
- SPL:
. Fixed bug #79151 (heap use after free caused by
spl_dllist_it_helper_move_forward). (Nikita)
- Standard:
. Fixed bug #78902 (Memory leak when using stream_filter_append). (liudaixiao)
- Testing:
. Fixed bug #78090 (bug45161.phpt takes forever to finish). (cmb)
- XSL:
. Fixed bug #70078 (XSL callbacks with nodes as parameter leak memory). (cmb)
23 Jan 2020, PHP 7.3.14
- Core
. Fixed bug #78999 (Cycle leak when using function result as temporary).
(Dmitry)
- CURL:
. Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
- Date:
. Fixed bug #79015 (undefined-behavior in php_date.c). (cmb)
- DBA:
. Fixed bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached).
(cmb)
- Fileinfo:
. Fixed bug #74170 (locale information change after mime_content_type).
(Sergei Turchanov)
- GD:
. Fixed bug #78923 (Artifacts when convoluting image with transparency).
(wilson chen)
. Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb)
. Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method).
(cmb)
- Libxml:
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
- Mbstring:
. Fixed bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`).
(CVE-2020-7060) (Nikita)
- OPcache:
. Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
- Pcntl:
. Fixed bug #78402 (Converting null to string in error message is bad DX).
(SATŌ Kentarō)
- PDO_PgSQL:
. Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ
Kentarō)
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
Kentarō)
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
Kentarō)
- Session:
. Fixed bug #79091 (heap use-after-free in session_create_id()). (cmb, Nikita)
- Shmop:
. Fixed bug #78538 (shmop memory leak). (cmb)
- Standard:
. Fixed bug #79099 (OOB read in php_strip_tags_ex). (CVE-2020-7059). (cmb)
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
(cmb)
18 Dec 2019, PHP 7.3.13
19 Dec 2019, PHP 7.3.13
- Bcmath:
. Fixed bug #78878 (Buffer underflow in bc_shift_addsub). (CVE-2019-11046).
+1 -7
View File
@@ -721,7 +721,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
TSRM_API int shmdt(const void *shmaddr)
{/*{{{*/
shm_pair *shm = shm_get(0, (void*)shmaddr);
int ret;
if (!shm->segment) {
return -1;
@@ -731,12 +730,7 @@ TSRM_API int shmdt(const void *shmaddr)
shm->descriptor->shm_lpid = getpid();
shm->descriptor->shm_nattch--;
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
if (!ret && shm->descriptor->shm_nattch <= 0) {
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
shm->descriptor = NULL;
}
return ret;
return UnmapViewOfFile(shm->addr) ? 0 : -1;
}/*}}}*/
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
-6
View File
@@ -490,12 +490,6 @@ JSON:
Curl:
. libcurl >= 7.15.5 is now required.
DBA:
. As of PHP 7.3.14, dba_open() accepts a fifth optional parameter for lmdb
databases which allows to specify the mapsize. The parameter defaults to
zero, in which case the compiled in default mapsize (usually 1048576) will
be used. The mapsize should be a multiple of the page size of the OS.
Filter:
. FILTER_VALIDATE_FLOAT now also supports a `thousand` option, which
defines the set of allowed thousand separator chars. The default (`"',."`)
+2 -2
View File
@@ -94,7 +94,7 @@ L0:
}
}));
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
class A {
use T1, T2 {
T1::foo insteadof foo;
@@ -244,7 +244,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c,
})) failed in %sexpect_015.php on line %d
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
class A {
use T1, T2 {
T1::foo insteadof foo;
+3 -2
View File
@@ -25,8 +25,9 @@ try {
--EXPECTF--
1. Exception: aaa in %sbug52361.php:5
Stack trace:
#0 %sbug52361.php(16): aaa->__destruct()
#1 {main}
#0 %sbug52361.php(13): aaa->__destruct()
#1 %sbug52361.php(16): bbb()
#2 {main}
2. Exception: bbb in %sbug52361.php:13
Stack trace:
#0 %sbug52361.php(16): bbb()
-68
View File
@@ -1,68 +0,0 @@
--TEST--
Bug #76047: Use-after-free when accessing already destructed backtrace arguments
--FILE--
<?php
class Vuln {
public $a;
public function __destruct() {
unset($this->a);
$backtrace = (new Exception)->getTrace();
var_dump($backtrace);
}
}
function test($arg) {
$arg = str_shuffle(str_repeat('A', 79));
$vuln = new Vuln();
$vuln->a = $arg;
}
function test2($arg) {
$$arg = 1; // Trigger symbol table
$arg = str_shuffle(str_repeat('A', 79));
$vuln = new Vuln();
$vuln->a = $arg;
}
test('x');
test2('x');
?>
--EXPECTF--
array(1) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(%d)
["function"]=>
string(10) "__destruct"
["class"]=>
string(4) "Vuln"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
array(1) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(%d)
["function"]=>
string(10) "__destruct"
["class"]=>
string(4) "Vuln"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Bug #78921: When Reflection triggers class load, property visibility is incorrect
--FILE--
<?php
spl_autoload_register(function($className) {
if ($className == 'PrivateStatic') {
class PrivateStatic
{
const SOME_CONST = 13;
private static $privateStaticVarArray = ['a', 'b', 'c'];
private static $otherStatic;
public static function init()
{
self::$otherStatic = self::$privateStaticVarArray;
}
}
PrivateStatic::init();
}
});
class OtherClass
{
const MY_CONST = PrivateStatic::SOME_CONST;
public static $prop = 'my property';
}
$reflectionClass = new ReflectionClass('OtherClass');
$reflectionProperty = $reflectionClass->getProperty('prop');
$reflectionProperty->setAccessible(true);
$value = $reflectionProperty->getValue();
echo "Value is $value\n";
?>
--EXPECT--
Value is my property
-17
View File
@@ -1,17 +0,0 @@
--TEST--
Bug #78999 (Cycle leak when using function result as temporary)
--FILE--
<?php
function get() {
$t = new stdClass;
$t->prop = $t;
return $t;
}
var_dump(get());
var_dump(gc_collect_cycles());
--EXPECT--
object(stdClass)#1 (1) {
["prop"]=>
*RECURSION*
}
int(1)
-9
View File
@@ -1,9 +0,0 @@
--TEST--
Incorrect constant evaluation of and/or (OSS-Fuzz #19255)
--FILE--
<?php
const C = 0 && __namespace__;
var_dump(C);
?>
--EXPECT--
bool(false)
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Freeing of function "name" when dynamic call fails
--FILE--
<?php
try {
$bar = "bar";
("foo" . $bar)();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
$bar = ["bar"];
(["foo"] + $bar)();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
(new stdClass)();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Call to undefined function foobar()
Function name must be a string
Function name must be a string
@@ -1,30 +0,0 @@
--TEST--
Generator exceptions during shutdown should not be swallowed
--FILE--
<?php
function gen() {
try {
echo "before yield\n";
yield;
echo "after yield\n";
} finally {
echo "before yield in finally\n";
yield;
echo "after yield in finally\n";
}
echo "after finally\n";
}
$gen = gen();
$gen->rewind();
?>
--EXPECTF--
before yield
before yield in finally
Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.15"
#define ZEND_VERSION "3.3.13"
#define ZEND_ENGINE_3
+1 -1
View File
@@ -1463,7 +1463,7 @@ simple_list:
}
break;
case ZEND_AST_TYPE:
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
switch (ast->attr) {
case IS_ARRAY: APPEND_STR("array");
case IS_CALLABLE: APPEND_STR("callable");
EMPTY_SWITCH_DEFAULT_CASE();
+14 -17
View File
@@ -8549,28 +8549,25 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
case ZEND_AST_AND:
case ZEND_AST_OR:
{
zend_bool child0_is_true, child1_is_true;
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
int i;
for (i = 0; i <= 1; i++) {
zend_eval_const_expr(&ast->child[i]);
if (ast->child[i]->kind == ZEND_AST_ZVAL) {
if (zend_is_true(zend_ast_get_zval(ast->child[i])) == (ast->kind == ZEND_AST_OR)) {
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
return;
}
}
}
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
return;
}
child0_is_true = zend_is_true(zend_ast_get_zval(ast->child[0]));
if (child0_is_true == (ast->kind == ZEND_AST_OR)) {
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
break;
}
if (ast->child[1]->kind != ZEND_AST_ZVAL) {
return;
}
child1_is_true = zend_is_true(zend_ast_get_zval(ast->child[1]));
if (ast->kind == ZEND_AST_OR) {
ZVAL_BOOL(&result, child0_is_true || child1_is_true);
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) || zend_is_true(zend_ast_get_zval(ast->child[1])));
} else {
ZVAL_BOOL(&result, child0_is_true && child1_is_true);
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) && zend_is_true(zend_ast_get_zval(ast->child[1])));
}
break;
}
-4
View File
@@ -836,7 +836,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
zend_string *lc_name;
zend_fcall_info fcall_info;
zend_fcall_info_cache fcall_cache;
zend_class_entry *orig_fake_scope;
if (key) {
lc_name = Z_STR_P(key);
@@ -923,14 +922,11 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
fcall_cache.called_scope = NULL;
fcall_cache.object = NULL;
orig_fake_scope = EG(fake_scope);
EG(fake_scope) = NULL;
zend_exception_save();
if ((zend_call_function(&fcall_info, &fcall_cache) == SUCCESS) && !EG(exception)) {
ce = zend_hash_find_ptr(EG(class_table), lc_name);
}
zend_exception_restore();
EG(fake_scope) = orig_fake_scope;
zval_ptr_dtor(&args[0]);
zval_ptr_dtor_str(&fcall_info.function_name);
+3 -4
View File
@@ -827,10 +827,9 @@ try_again:
if (UNEXPECTED(EG(exception) != NULL)) {
if (generator == orig_generator) {
zend_generator_close(generator, 0);
if (!EG(current_execute_data)) {
zend_throw_exception_internal(NULL);
} else if (EG(current_execute_data)->func &&
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
if (EG(current_execute_data) &&
EG(current_execute_data)->func &&
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
zend_rethrow_exception(EG(current_execute_data));
}
} else {
+1 -1
View File
@@ -310,7 +310,7 @@ static void zval_ini_dtor(zval *zv)
%left '|' '&' '^'
%right '~' '!'
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL cfg_var_ref constant_literal constant_string encapsed_list expr option_offset section_string_or_value string_or_value var_string_list var_string_list_section
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
%%
+6 -8
View File
@@ -2398,9 +2398,9 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
uint32_t call_info = EX_CALL_INFO();
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
zend_object *object = Z_OBJ(execute_data->This);
#if 0
@@ -2426,12 +2426,12 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
LOAD_NEXT_OPLINE();
ZEND_VM_LEAVE();
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
EG(current_execute_data) = EX(prev_execute_data);
/* Free extra args before releasing the closure,
* as that may free the op_array. */
@@ -2481,7 +2481,6 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
ZEND_VM_LEAVE();
} else {
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
@@ -2489,6 +2488,7 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
}
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
}
@@ -3344,11 +3344,11 @@ ZEND_VM_C_LABEL(try_function_name):
call = NULL;
}
FREE_OP2();
if (UNEXPECTED(!call)) {
HANDLE_EXCEPTION();
}
FREE_OP2();
if (OP2_TYPE & (IS_VAR|IS_TMP_VAR)) {
if (UNEXPECTED(EG(exception))) {
if (call) {
@@ -3360,6 +3360,8 @@ ZEND_VM_C_LABEL(try_function_name):
}
HANDLE_EXCEPTION();
}
} else if (UNEXPECTED(!call)) {
HANDLE_EXCEPTION();
}
call->prev_execute_data = EX(call);
@@ -3860,10 +3862,6 @@ ZEND_VM_HOT_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
+13 -39
View File
@@ -507,9 +507,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
uint32_t call_info = EX_CALL_INFO();
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
zend_object *object = Z_OBJ(execute_data->This);
#if 0
@@ -535,12 +535,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
LOAD_NEXT_OPLINE();
ZEND_VM_LEAVE();
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
EG(current_execute_data) = EX(prev_execute_data);
/* Free extra args before releasing the closure,
* as that may free the op_array. */
@@ -590,7 +590,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
ZEND_VM_LEAVE();
} else {
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
@@ -598,6 +597,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
}
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
}
@@ -2137,6 +2137,8 @@ try_function_name:
}
HANDLE_EXCEPTION();
}
} else if (UNEXPECTED(!call)) {
HANDLE_EXCEPTION();
}
call->prev_execute_data = EX(call);
@@ -2311,11 +2313,11 @@ try_function_name:
call = NULL;
}
zval_ptr_dtor_nogc(free_op2);
if (UNEXPECTED(!call)) {
HANDLE_EXCEPTION();
}
zval_ptr_dtor_nogc(free_op2);
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
if (UNEXPECTED(EG(exception))) {
if (call) {
@@ -2327,6 +2329,8 @@ try_function_name:
}
HANDLE_EXCEPTION();
}
} else if (UNEXPECTED(!call)) {
HANDLE_EXCEPTION();
}
call->prev_execute_data = EX(call);
@@ -2442,6 +2446,8 @@ try_function_name:
}
HANDLE_EXCEPTION();
}
} else if (UNEXPECTED(!call)) {
HANDLE_EXCEPTION();
}
call->prev_execute_data = EX(call);
@@ -2727,10 +2733,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -17669,10 +17671,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -20441,10 +20439,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -36887,10 +36881,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -55379,9 +55369,9 @@ zend_leave_helper_SPEC_LABEL:
uint32_t call_info = EX_CALL_INFO();
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
zend_object *object = Z_OBJ(execute_data->This);
#if 0
@@ -55407,12 +55397,12 @@ zend_leave_helper_SPEC_LABEL:
LOAD_NEXT_OPLINE();
ZEND_VM_LEAVE();
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
zend_clean_and_cache_symbol_table(EX(symbol_table));
}
EG(current_execute_data) = EX(prev_execute_data);
/* Free extra args before releasing the closure,
* as that may free the op_array. */
@@ -55462,7 +55452,6 @@ zend_leave_helper_SPEC_LABEL:
ZEND_VM_LEAVE();
} else {
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
EG(current_execute_data) = EX(prev_execute_data);
i_free_compiled_variables(execute_data);
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
@@ -55470,6 +55459,7 @@ zend_leave_helper_SPEC_LABEL:
}
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
}
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
}
@@ -55730,10 +55720,6 @@ zend_leave_helper_SPEC_LABEL:
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -57348,10 +57334,6 @@ zend_leave_helper_SPEC_LABEL:
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -57638,10 +57620,6 @@ zend_leave_helper_SPEC_LABEL:
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
@@ -59284,10 +59262,6 @@ zend_leave_helper_SPEC_LABEL:
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
ZVAL_COPY_VALUE(return_value, retval_ptr);
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
if (GC_MAY_LEAK(ref)) {
gc_possible_root(ref);
}
ZVAL_NULL(retval_ptr);
} else {
Z_ADDREF_P(return_value);
+1 -1
View File
@@ -1,5 +1,5 @@
@echo off
cscript /nologo /e:jscript win32\build\buildconf.js %*
cscript /nologo win32\build\buildconf.js %*
SET PHP_BUILDCONF_PATH=%~dp0
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
SET PHP_SDK_SCRIPT_PATH=
+1 -1
View File
@@ -107,7 +107,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=15
PHP_RELEASE_VERSION=13
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`
-2
View File
@@ -2,8 +2,6 @@
easter_date()
--INI--
date.timezone=UTC
--ENV--
TZ=UTC
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
+1 -59
View File
@@ -1452,10 +1452,6 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
#endif
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
REGISTER_CURL_CONSTANT(CURLOPT_HTTP09_ALLOWED);
#endif
#if LIBCURL_VERSION_NUM >= 0x074001 /* Available since 7.64.1 */
REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC);
#endif
@@ -1848,11 +1844,7 @@ static void curl_free_string(void **string)
*/
static void curl_free_post(void **post)
{
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
curl_mime_free((curl_mime *)*post);
#else
curl_formfree((struct HttpPost *)*post);
#endif
}
/* }}} */
@@ -2369,9 +2361,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
#endif
#if LIBCURL_VERSION_NUM >= 0x073d00 /* Available since 7.61.0 */
case CURLOPT_DISALLOW_USERNAME_IN_URL:
#endif
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
case CURLOPT_HTTP09_ALLOWED:
#endif
lval = zval_get_long(zvalue);
#if LIBCURL_VERSION_NUM >= 0x071304
@@ -2775,30 +2764,16 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
HashTable *postfields;
zend_string *string_key;
zend_ulong num_key;
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
curl_mime *mime = NULL;
curl_mimepart *part;
CURLcode form_error;
#else
struct HttpPost *first = NULL;
struct HttpPost *last = NULL;
CURLFORMcode form_error;
#endif
postfields = HASH_OF(zvalue);
if (!postfields) {
php_error_docref(NULL, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
return FAILURE;
}
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
if (zend_hash_num_elements(postfields) > 0) {
mime = curl_mime_init(ch->cp);
if (mime == NULL) {
return FAILURE;
}
}
#endif
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
zend_string *postval, *tmp_postval;
/* Pretend we have a string_key here */
@@ -2833,20 +2808,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
filename = Z_STRVAL_P(prop);
}
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
part = curl_mime_addpart(mime);
if (part == NULL) {
zend_string_release_ex(string_key, 0);
return FAILURE;
}
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|| (form_error = curl_mime_filedata(part, ZSTR_VAL(postval))) != CURLE_OK
|| (form_error = curl_mime_filename(part, filename ? filename : ZSTR_VAL(postval))) != CURLE_OK
|| (form_error = curl_mime_type(part, type ? type : "application/octet-stream")) != CURLE_OK) {
error = form_error;
}
#else
form_error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, ZSTR_VAL(string_key),
CURLFORM_NAMELENGTH, ZSTR_LEN(string_key),
@@ -2858,7 +2819,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
/* Not nice to convert between enums but we only have place for one error type */
error = (CURLcode)form_error;
}
#endif
}
zend_string_release_ex(string_key, 0);
@@ -2867,18 +2827,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
postval = zval_get_tmp_string(current, &tmp_postval);
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
part = curl_mime_addpart(mime);
if (part == NULL) {
zend_tmp_string_release(tmp_postval);
zend_string_release_ex(string_key, 0);
return FAILURE;
}
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|| (form_error = curl_mime_data(part, ZSTR_VAL(postval), ZSTR_LEN(postval))) != CURLE_OK) {
error = form_error;
}
#else
/* The arguments after _NAMELENGTH and _CONTENTSLENGTH
* must be explicitly cast to long in curl_formadd
* use since curl needs a long not an int. */
@@ -2893,7 +2841,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
/* Not nice to convert between enums but we only have place for one error type */
error = (CURLcode)form_error;
}
#endif
zend_tmp_string_release(tmp_postval);
zend_string_release_ex(string_key, 0);
} ZEND_HASH_FOREACH_END();
@@ -2906,13 +2853,8 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
if ((*ch->clone) == 1) {
zend_llist_clean(&ch->to_free->post);
}
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
zend_llist_add_element(&ch->to_free->post, &mime);
error = curl_easy_setopt(ch->cp, CURLOPT_MIMEPOST, mime);
#else
zend_llist_add_element(&ch->to_free->post, &first);
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
#endif
} else {
#if LIBCURL_VERSION_NUM >= 0x071101
zend_string *tmp_str;
-2
View File
@@ -92,8 +92,6 @@ PHP_FUNCTION(curl_multi_add_handle)
RETURN_FALSE;
}
_php_curl_verify_handlers(ch, 1);
_php_curl_cleanup_handle(ch);
GC_ADDREF(Z_RES_P(z_ch));
+8 -5
View File
@@ -2,7 +2,12 @@
Bug #45161 (Reusing a curl handle leaks memory)
--SKIPIF--
<?php
include 'skipif.inc';
if (substr(PHP_OS, 0, 3) == 'WIN') {
exit("skip not for Windows");
}
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
$curl_version = curl_version();
if ($curl_version['version_number'] < 0x071100) {
exit("skip: test works only with curl >= 7.17.0");
@@ -10,12 +15,10 @@ if ($curl_version['version_number'] < 0x071100) {
?>
--FILE--
<?php
include 'server.inc';
$host = curl_cli_server_start();
// Fill memory for test
$ch = curl_init();
$fp = fopen(PHP_OS_FAMILY === 'Windows' ? 'nul' : '/dev/null', 'w');
$fp = fopen('/dev/null', 'w');
/*
$i = $start = $end = 100000.00;
@@ -29,7 +32,7 @@ for ($i = 0; $i < 100; $i++) {
// Start actual test
$start = memory_get_usage() + 1024;
for($i = 0; $i < 1024; $i++) {
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc");
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
}
+4 -5
View File
@@ -2,14 +2,13 @@
Bug #46739 (array returned by curl_getinfo should contain content_type key)
--SKIPIF--
<?php
include 'skipif.inc';
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
?>
--FILE--
<?php
include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init("{$host}/get.inc");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch = curl_init('http://127.0.0.1:9/');
curl_exec($ch);
$info = curl_getinfo($ch);
+9 -9
View File
@@ -67,25 +67,25 @@ foreach($options_to_check as $option) {
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
--EXPECTF--
Warning: curl_multi_add_handle(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
%A
Warning: curl_multi_add_handle(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
%A
Ok for CURLOPT_STDERR
Warning: curl_multi_add_handle(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_add_handle(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
Ok for CURLOPT_WRITEHEADER
Warning: curl_multi_add_handle(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_add_handle(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
Hello World!
Hello World!Hello World!
Hello World!Ok for CURLOPT_FILE
Warning: curl_multi_add_handle(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_add_handle(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
Ok for CURLOPT_INFILE
-1
View File
@@ -3,7 +3,6 @@ Bug #78775: TLS issues from HTTP request affecting other encrypted connections
--SKIPIF--
<?php
if (!extension_loaded('curl')) die('skip Requires curl');
if (!extension_loaded('openssl')) die('skip Requires openssl');
if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
?>
--FILE--
-29
View File
@@ -1,29 +0,0 @@
--TEST--
Bug #79033 (Curl timeout error with specific url and post)
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "{$host}/get.inc?test=post",
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [],
CURLINFO_HEADER_OUT => true,
CURLOPT_RETURNTRANSFER => true,
]);
var_dump(curl_exec($ch));
var_dump(curl_getinfo($ch)["request_header"]);
?>
--EXPECTF--
string(%d) "array(0) {
}
"
string(90) "POST /get.inc?test=post HTTP/1.1
Host: localhost:%d
Accept: */*
Content-Length: 0
"
+5 -8
View File
@@ -3297,7 +3297,6 @@ PHP_METHOD(DateTimeImmutable, modify)
date_clone_immutable(object, &new_object);
if (!php_date_modify(&new_object, modify, modify_len)) {
zval_ptr_dtor(&new_object);
RETURN_FALSE;
}
@@ -4390,16 +4389,14 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
{
do {
zval *z_arg = zend_hash_str_find(myht, "f", sizeof("f") - 1);
(*intobj)->diff->us = -1000000;
if (z_arg) {
double val = zval_get_double(z_arg) * 1000000;
if (val >= 0 && val < 1000000) {
(*intobj)->diff->us = val;
}
(*intobj)->diff->us = ((double)zval_get_double(z_arg) * 1000000);
} else {
(*intobj)->diff->us = (double) -1000000;
}
}
} while (0);
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
@@ -1,12 +0,0 @@
--TEST--
DateTimeImmutable::modify() with invalid format
--FILE--
<?php
$datetime = new DateTimeImmutable;
var_dump($datetime->modify(''));
?>
--EXPECTF--
Warning: DateTimeImmutable::modify(): Failed to parse time string () at position 0 ( in %s on line %d
bool(false)
-42
View File
@@ -1,42 +0,0 @@
--TEST--
Bug #79015 (undefined-behavior in php_date.c)
--FILE--
<?php
$payload = 'O:12:"DateInterval":16:{s:1:"y";i:1;s:1:"m";i:0;s:1:"d";i:4;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";i:9999999999990;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";b:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}';
var_dump(unserialize($payload));
?>
--EXPECTF--
object(DateInterval)#%d (16) {
["y"]=>
int(1)
["m"]=>
int(0)
["d"]=>
int(4)
["h"]=>
int(0)
["i"]=>
int(0)
["s"]=>
int(0)
["f"]=>
float(-1)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
-16
View File
@@ -43,18 +43,10 @@ DBA_OPEN_FUNC(lmdb)
MDB_env *env;
MDB_txn *txn;
int rc, mode = 0644, flags = MDB_NOSUBDIR;
zend_long mapsize = 0;
if(info->argc > 0) {
mode = zval_get_long(&info->argv[0]);
if (info->argc > 1) {
mapsize = zval_get_long(&info->argv[1]);
if (mapsize < 0) {
*error = "mapsize must be greater than or equal to zero";
return FAILURE;
}
}
/* TODO implement handling of the additional flags. */
}
@@ -64,14 +56,6 @@ DBA_OPEN_FUNC(lmdb)
return FAILURE;
}
if (mapsize > 0) {
rc = mdb_env_set_mapsize(env, (size_t) mapsize);
if (rc) {
*error = mdb_strerror(rc);
return FAILURE;
}
}
rc = mdb_env_open(env, info->path, flags, mode);
if (rc) {
*error = mdb_strerror(rc);
-25
View File
@@ -1,25 +0,0 @@
--TEST--
Bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached)
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
$handler = 'lmdb';
require_once __DIR__ .'/skipif.inc';
?>
--FILE--
<?php
$handler = 'lmdb';
require_once __DIR__ .'/test.inc';
$lmdb_h = dba_open($db_filename, 'c', 'lmdb', 0644, 5*1048576);
for ($i = 0; $i < 50000; $i++) {
dba_insert('key' . $i, 'value '. $i, $lmdb_h);
}
dba_close($lmdb_h);
echo "done\n";
?>
--EXPECT--
done
--CLEAN--
<?php
require_once dirname(__FILE__) .'/clean.inc';
?>
+4 -1
View File
@@ -477,9 +477,11 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
zend_string *repl;
size_t rep_cnt = 0;
(void)setlocale(LC_CTYPE, "C");
opts |= PCRE2_MULTILINE;
convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
if ((pce = pcre_get_compiled_regex_cache_ex(Z_STR(patt), 0)) == NULL) {
if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
zval_ptr_dtor(&patt);
rep_cnt = -1;
goto out;
@@ -501,6 +503,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
zend_string_release_ex(res, 0);
out:
(void)setlocale(LC_CTYPE, "");
return rep_cnt;
}
+4 -14
View File
@@ -116,24 +116,14 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv)
{
size_t i;
const char *rv = NULL;
char *vbuf_lower;
vbuf_lower = zend_str_tolower_dup(vbuf, strlen(vbuf));
for (i = 0; nv[i].pattern != NULL; i++) {
char *pattern_lower;
int found;
pattern_lower = zend_str_tolower_dup(nv[i].pattern, strlen(nv[i].pattern));
found = (strstr(vbuf_lower, pattern_lower) != NULL);
efree(pattern_lower);
if (found) {
(void)setlocale(LC_CTYPE, "C");
for (i = 0; nv[i].pattern != NULL; i++)
if (strcasestr(vbuf, nv[i].pattern) != NULL) {
rv = nv[i].mime;
break;
}
}
efree(vbuf_lower);
(void)setlocale(LC_CTYPE, "");
return rv;
}
+8 -6
View File
@@ -422,25 +422,27 @@ flush:
private int
check_fmt(struct magic_set *ms, const char *fmt)
{
pcre_cache_entry *pce;
pcre2_code *pce;
uint32_t re_options, capture_count;
int rv = -1;
zend_string *pattern;
if (strchr(fmt, '%') == NULL)
return 0;
(void)setlocale(LC_CTYPE, "C");
pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0)) == NULL) {
if ((pce = pcre_get_compiled_regex(pattern, &capture_count, &re_options)) == NULL) {
rv = -1;
} else {
pcre2_code *re = php_pcre_pce_re(pce);
pcre2_match_data *match_data = php_pcre_create_match_data(0, re);
pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
if (match_data) {
rv = pcre2_match(re, (PCRE2_SPTR)fmt, strlen(fmt), 0, 0, match_data, php_pcre_mctx()) > 0;
rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, re_options, match_data, php_pcre_mctx()) > 0;
php_pcre_free_match_data(match_data);
}
}
zend_string_release(pattern);
zend_string_release_ex(pattern, 0);
(void)setlocale(LC_CTYPE, "");
return rv;
}
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #74170 locale information change after mime_content_type
--SKIPIF--
<?php
if (!class_exists('finfo'))
die('skip no fileinfo extension');
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (setlocale(LC_CTYPE, 'ru_RU.koi8r') === false)
die('skip ru_RU.koi8r locale is not available');
?>
--FILE--
<?php
var_dump(setlocale(LC_CTYPE, 'ru_RU.koi8r'));
var_dump(nl_langinfo(CODESET));
var_dump(mime_content_type(__DIR__ . '/resources/test.ppt'));
var_dump(nl_langinfo(CODESET));
--EXPECT--
string(11) "ru_RU.koi8r"
string(6) "KOI8-R"
string(29) "application/vnd.ms-powerpoint"
string(6) "KOI8-R"
-1
View File
@@ -264,7 +264,6 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
for ( y=0; y<src->sy; y++) {
for(x=0; x<src->sx; x++) {
new_r = new_g = new_b = 0;
pxl = f(srcback, x, y);
new_a = gdImageAlpha(srcback, pxl);
for (j=0; j<3; j++) {
+3 -6
View File
@@ -2334,7 +2334,7 @@ int gdTransformAffineGetImage(gdImagePtr *dst,
* src_area - Rectangular region to rotate in the src image
*
* Returns:
* GD_TRUE on success or GD_FALSE on failure
* GD_TRUE if the affine is rectilinear or GD_FALSE
*/
int gdTransformAffineCopy(gdImagePtr dst,
int dst_x, int dst_y,
@@ -2351,7 +2351,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
gdPointF pt, src_pt;
gdRect bbox;
int end_x, end_y;
gdInterpolationMethod interpolation_id_bak = src->interpolation_id;
gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
interpolation_method interpolation_bak;
/* These methods use special implementations */
@@ -2393,10 +2393,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
end_y = bbox.height + (int) fabs(bbox.y);
/* Get inverse affine to let us work with destination -> source */
if (gdAffineInvert(inv, affine) == GD_FALSE) {
gdImageSetInterpolationMethod(src, interpolation_id_bak);
return GD_FALSE;
}
gdAffineInvert(inv, affine);
src_offset_x = src_region->x;
src_offset_y = src_region->y;
+1 -1
View File
@@ -55,7 +55,7 @@ int gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src,
* <gdAffineIdentity>
*
* Returns:
* GD_TRUE on success or GD_FALSE on failure
* GD_TRUE if the affine is rectilinear or GD_FALSE
*/
int gdAffineInvert (double dst[6], const double src[6])
{
+3 -1
View File
@@ -1,9 +1,11 @@
--TEST--
Bug #47946 (ImageConvolution overwrites background)
--DESCRIPTION--
The expected image has black pixel artifacts, what is another issue, though
(perhaps #40158).
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
?>
--FILE--
<?php
Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 396 B

-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #79067 (gdTransformAffineCopy() may use unitialized values)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$matrix = [1, 1, 1, 1, 1, 1];
$src = imagecreatetruecolor(8, 8);
var_dump(imageaffine($src, $matrix));
?>
--EXPECT--
bool(false)
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug #79068 (gdTransformAffineCopy() changes interpolation method)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
require_once __DIR__ . '/func.inc';
$src = imagecreatetruecolor(100, 100);
imagefilledrectangle($src, 0, 0, 99, 99, 0xffffff);
imageline($src, 10, 10, 90, 90, 0x000000);
imagesetinterpolation($src, IMG_BSPLINE);
imageaffine($src, [1, 1, 1, 1, 1, 1]);
$dst = imagerotate($src, 80, 0xffffff);
test_image_equals_file(__DIR__ . '/bug79068.png', $dst);
?>
--EXPECT--
The images are equal.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

+15 -15
View File
@@ -53,23 +53,23 @@ PHP_FUNCTION( numfmt_format )
/* Fetch the object. */
FORMATTER_METHOD_FETCH_OBJECT;
if(Z_TYPE_P(number) != IS_ARRAY) {
convert_scalar_to_number_ex(number);
} else {
convert_to_long(number);
if(type == FORMAT_TYPE_DEFAULT) {
if(Z_TYPE_P(number) == IS_STRING) {
convert_scalar_to_number_ex(number);
}
if(Z_TYPE_P(number) == IS_LONG) {
/* take INT32 on 32-bit, int64 on 64-bit */
type = (sizeof(zend_long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32;
} else if(Z_TYPE_P(number) == IS_DOUBLE) {
type = FORMAT_TYPE_DOUBLE;
} else {
type = FORMAT_TYPE_INT32;
}
}
if(type == FORMAT_TYPE_DEFAULT) {
switch(Z_TYPE_P(number)) {
case IS_LONG:
/* take INT32 on 32-bit, int64 on 64-bit */
type = (sizeof(zend_long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32;
break;
case IS_DOUBLE:
type = FORMAT_TYPE_DOUBLE;
break;
EMPTY_SWITCH_DEFAULT_CASE();
}
if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_LONG) {
convert_scalar_to_number(number );
}
switch(type) {
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #79212 (NumberFormatter::format() may detect wrong type)
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not available');
if (!extension_loaded('gmp')) die('skip gmp extension not available');
?>
--FILE--
<?php
$fmt = new NumberFormatter('en_US', NumberFormatter::PATTERN_DECIMAL);
var_dump($fmt->format(gmp_init('823749273428379492374')));
$fmt = new NumberFormatter('en_US', NumberFormatter::PATTERN_DECIMAL);
var_dump($fmt->format([1], NumberFormatter::TYPE_INT64));
?>
--EXPECTF--
string(21) "823749273428379%c%c%c%c%c%c"
string(1) "1"
+3 -4
View File
@@ -358,10 +358,6 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
context = php_stream_context_from_zval(Z_ISUNDEF(LIBXML(stream_context))? NULL : &LIBXML(stream_context), 0);
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
if (ret_val) {
/* Prevent from closing this by fclose() */
((php_stream*)ret_val)->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
}
if (isescaped) {
xmlFree(resolved_path);
}
@@ -385,6 +381,9 @@ static int php_libxml_streams_IO_read(void *context, char *buffer, int len)
static int php_libxml_streams_IO_write(void *context, const char *buffer, int len)
{
if (CG(unclean_shutdown)) {
return -1;
}
return php_stream_write((php_stream*)context, buffer, len);
}
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #79191 (Error in SoapClient ctor disables DOMDocument::save())
--SKIPIF--
<?php
if (!extension_loaded('soap')) die('skip soap extension not available');
if (!extension_loaded('dom')) die('dom extension not available');
?>
--FILE--
<?php
try {
new \SoapClient('does-not-exist.wsdl');
} catch (Throwable $t) {
}
$dom = new DOMDocument;
$dom->loadxml('<?xml version="1.0" ?><root />');
var_dump($dom->save(__DIR__ . '/bug79191.xml'));
?>
--CLEAN--
<?php
unlink(__DIR__ . '/bug79191.xml');
?>
--EXPECTF--
int(%d)
+2 -2
View File
@@ -145,10 +145,10 @@ static unsigned short cp950_pua_tbl[][4] = {
static inline int is_in_cp950_pua(int c1, int c) {
if ((c1 >= 0xfa && c1 <= 0xfe) || (c1 >= 0x8e && c1 <= 0xa0) ||
(c1 >= 0x81 && c1 <= 0x8d) || (c1 >= 0xc7 && c1 <= 0xc8)) {
return (c >=0x40 && c <= 0x7e) || (c >= 0xa1 && c <= 0xfe);
return (c > 0x39 && c < 0x7f) || (c > 0xa0 && c < 0xff);
}
if (c1 == 0xc6) {
return c >= 0xa1 && c <= 0xfe;
return c > 0xa0 && c < 0xff;
}
return 0;
}
+6 -6
View File
@@ -3232,18 +3232,18 @@ PHP_FUNCTION(mb_convert_encoding)
_from_encodings = NULL;
ZEND_HASH_FOREACH_VAL(target_hash, hash_entry) {
zend_string *encoding_str = zval_get_string(hash_entry);
convert_to_string_ex(hash_entry);
if ( _from_encodings) {
l = strlen(_from_encodings);
n = strlen(ZSTR_VAL(encoding_str));
n = strlen(Z_STRVAL_P(hash_entry));
_from_encodings = erealloc(_from_encodings, l+n+2);
memcpy(_from_encodings + l, ",", 1);
memcpy(_from_encodings + l + 1, ZSTR_VAL(encoding_str), ZSTR_LEN(encoding_str) + 1);
memcpy(_from_encodings + l + 1, Z_STRVAL_P(hash_entry), Z_STRLEN_P(hash_entry) + 1);
} else {
_from_encodings = estrdup(ZSTR_VAL(encoding_str));
_from_encodings = estrdup(Z_STRVAL_P(hash_entry));
}
zend_string_release(encoding_str);
} ZEND_HASH_FOREACH_END();
if (_from_encodings != NULL && !strlen(_from_encodings)) {
@@ -4850,7 +4850,7 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char*
no_enc = enc->no_encoding;
if (php_mb_is_unsupported_no_encoding(no_enc)) {
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc->name);
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc_name);
return -1;
}
+3 -6
View File
@@ -149,7 +149,6 @@ PHP_RSHUTDOWN_FUNCTION(mb_regex)
ZVAL_UNDEF(&MBREX(search_str));
}
MBREX(search_pos) = 0;
MBREX(search_re) = NULL;
if (MBREX(search_regs) != NULL) {
onig_region_free(MBREX(search_regs), 1);
@@ -1427,11 +1426,6 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
_php_mb_regex_init_options(arg_options, arg_options_len, &option, &syntax, NULL);
}
if (MBREX(search_regs)) {
onig_region_free(MBREX(search_regs), 1);
MBREX(search_regs) = NULL;
}
if (arg_pattern) {
/* create regex pattern buffer */
if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
@@ -1457,6 +1451,9 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
RETURN_FALSE;
}
if (MBREX(search_regs)) {
onig_region_free(MBREX(search_regs), 1);
}
MBREX(search_regs) = onig_region_new();
err = _php_mb_onig_search(MBREX(search_re), str, str + len, str + pos, str + len, MBREX(search_regs), 0);
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Bug #79037: global buffer-overflow in `mbfl_filt_conv_big5_wchar`
--FILE--
<?php
var_dump(mb_convert_encoding("\x81\x3a", "UTF-8", "CP950"));
?>
--EXPECT--
string(1) "?"
-34
View File
@@ -1,34 +0,0 @@
--TEST--
Bug 79154 (mb_convert_encoding() can modify $from_encoding)
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('mbstring extension not available');
?>
--FILE--
<?php
class Utf8Encoding
{
public function __toString()
{
return 'UTF-8';
}
}
$utf8encoding = new Utf8Encoding();
$encodings = [$utf8encoding];
var_dump($encodings);
mb_convert_encoding('foo', 'UTF-8', $encodings);
var_dump($encodings);
?>
--EXPECTF--
array(1) {
[0]=>
object(Utf8Encoding)#%d (0) {
}
}
array(1) {
[0]=>
object(Utf8Encoding)#%d (0) {
}
}
@@ -1,19 +0,0 @@
--TEST--
mb_ereg_search() with invalid pattern should discard old matches
--SKIPIF--
<?php if (!function_exists("mb_ereg")) print "skip requires mbregex"; ?>
--FILE--
<?php
mb_ereg_search_init('');
var_dump(mb_ereg_search(''));
var_dump(mb_ereg_search("\xff"));
var_dump(mb_ereg_search_getregs());
?>
--EXPECTF--
bool(true)
Warning: mb_ereg_search(): Pattern is not valid under UTF-8 encoding in %s on line %d
bool(false)
bool(false)
+3 -8
View File
@@ -19,9 +19,6 @@ var_dump(
mb_ord("\u{d800}", "utf-7"),
mb_ord("")
);
mb_internal_encoding("utf-7");
mb_ord("");
?>
--EXPECTF--
bool(true)
@@ -32,11 +29,11 @@ Warning: mb_ord(): Unknown encoding "typo" %s 10
Warning: mb_ord(): Unsupported encoding "pass" %s 11
Warning: mb_ord(): Unsupported encoding "JIS" in %s on line %d
Warning: mb_ord(): Unsupported encoding "jis" %s 12
Warning: mb_ord(): Unsupported encoding "CP50222" in %s on line %d
Warning: mb_ord(): Unsupported encoding "cp50222" %s 13
Warning: mb_ord(): Unsupported encoding "UTF-7" in %s on line %d
Warning: mb_ord(): Unsupported encoding "utf-7" %s 14
Warning: mb_ord(): Empty string in %s on line %d
bool(false)
@@ -45,5 +42,3 @@ bool(false)
bool(false)
bool(false)
bool(false)
Warning: mb_ord(): Unsupported encoding "UTF-7" in %s on line %d
-79
View File
@@ -1,79 +0,0 @@
--TEST--
Bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once('connect.inc');
$sql = "SELECT 0 as `2007`, 0 as `2008`, 0 as `2020`";
// unbuffered
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link->real_query($sql);
$res = $link->use_result();
$row = $res->fetch_array();
var_dump($row);
$link->close();
// buffered
ini_set('mysqlnd.fetch_data_copy', false);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$res = $link->query($sql);
$row = $res->fetch_array();
var_dump($row);
$link->close();
// buffered copies
ini_set('mysqlnd.fetch_data_copy', true);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$res = $link->query($sql);
$row = $res->fetch_array();
var_dump($row);
$link->close();
?>
--EXPECT--
array(6) {
[0]=>
string(1) "0"
[2007]=>
string(1) "0"
[1]=>
string(1) "0"
[2008]=>
string(1) "0"
[2]=>
string(1) "0"
[2020]=>
string(1) "0"
}
array(6) {
[0]=>
string(1) "0"
[2007]=>
string(1) "0"
[1]=>
string(1) "0"
[2008]=>
string(1) "0"
[2]=>
string(1) "0"
[2020]=>
string(1) "0"
}
array(6) {
[0]=>
string(1) "0"
[2007]=>
string(1) "0"
[1]=>
string(1) "0"
[2008]=>
string(1) "0"
[2]=>
string(1) "0"
[2020]=>
string(1) "0"
}
-61
View File
@@ -1,61 +0,0 @@
--TEST--
Bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH) - collision
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once('connect.inc');
$sql = "SELECT 11111 as `1`, 22222 as `2`";
// unbuffered
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link->real_query($sql);
$res = $link->use_result();
$row = $res->fetch_array();
var_dump($row);
$link->close();
// buffered
ini_set('mysqlnd.fetch_data_copy', false);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$res = $link->query($sql);
$row = $res->fetch_array();
var_dump($row);
$link->close();
// buffered copies
ini_set('mysqlnd.fetch_data_copy', true);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$res = $link->query($sql);
$row = $res->fetch_array();
var_dump($row);
$link->close();
?>
--EXPECT--
array(3) {
[0]=>
string(5) "11111"
[1]=>
string(5) "11111"
[2]=>
string(5) "22222"
}
array(3) {
[0]=>
string(5) "11111"
[1]=>
string(5) "11111"
[2]=>
string(5) "22222"
}
array(3) {
[0]=>
string(5) "11111"
[1]=>
string(5) "11111"
[2]=>
string(5) "22222"
}
@@ -17,8 +17,6 @@ if (defined('MYSQLI_DEBUG_TRACE_ENABLED') && !MYSQLI_DEBUG_TRACE_ENABLED)
if (!$IS_MYSQLND)
die("SKIP Libmysql feature not sufficiently spec'd in MySQL C API documentation");
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test is not for Windows platforms");
?>
--FILE--
<?php
@@ -7,7 +7,7 @@ require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
?>
--INI--
mysqlnd.debug=d:t:O,{TMP}/mysqlnd.trace
mysqlnd.debug=d:t:O,/tmp/mysqlnd.trace
--FILE--
<?php
require_once("connect.inc");
@@ -10,7 +10,7 @@ if (!$IS_MYSQLND) {
}
?>
--INI--
mysqlnd.debug=d:t:O,{TMP}/mysqlnd.trace
mysqlnd.debug=d:t:O,/tmp/mysqlnd.trace
mysqlnd.net_read_buffer_size=1
mysqlnd.mempool_default_size=1
mysqlnd.fetch_data_copy=0
+6 -9
View File
@@ -842,9 +842,8 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
const size_t len = (Z_TYPE_P(data) == IS_STRING)? Z_STRLEN_P(data) : 0;
if (flags & MYSQLND_FETCH_NUM) {
if (zend_hash_index_add(row_ht, i, data) != NULL) {
Z_TRY_ADDREF_P(data);
}
Z_TRY_ADDREF_P(data);
zend_hash_next_index_insert(row_ht, data);
}
if (flags & MYSQLND_FETCH_ASSOC) {
/* zend_hash_quick_update needs length + trailing zero */
@@ -1100,9 +1099,8 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, vo
set->lengths[i] = (Z_TYPE_P(data) == IS_STRING)? Z_STRLEN_P(data) : 0;
if (flags & MYSQLND_FETCH_NUM) {
if (zend_hash_index_add(Z_ARRVAL_P(row), i, data) != NULL) {
Z_TRY_ADDREF_P(data);
}
Z_TRY_ADDREF_P(data);
zend_hash_next_index_insert(Z_ARRVAL_P(row), data);
}
if (flags & MYSQLND_FETCH_ASSOC) {
/* zend_hash_quick_update needs length + trailing zero */
@@ -1197,9 +1195,8 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void
set->lengths[i] = (Z_TYPE_P(data) == IS_STRING)? Z_STRLEN_P(data) : 0;
if (flags & MYSQLND_FETCH_NUM) {
if (zend_hash_index_add(Z_ARRVAL_P(row), i, data)) {
Z_TRY_ADDREF_P(data);
}
Z_TRY_ADDREF_P(data);
zend_hash_next_index_insert(Z_ARRVAL_P(row), data);
}
if (flags & MYSQLND_FETCH_ASSOC) {
/* zend_hash_quick_update needs length + trailing zero */
+1 -1
View File
@@ -533,7 +533,7 @@ static const func_info_t func_infos[] = {
F0("var_dump", MAY_BE_NULL),
F1("var_export", MAY_BE_NULL | MAY_BE_STRING),
F0("debug_zval_dump", MAY_BE_NULL),
F1("print_r", MAY_BE_TRUE | MAY_BE_STRING),
F1("print_r", MAY_BE_FALSE | MAY_BE_STRING),
F0("memory_get_usage", MAY_BE_FALSE | MAY_BE_LONG),
F0("memory_get_peak_usage", MAY_BE_FALSE | MAY_BE_LONG),
F0("register_shutdown_function", MAY_BE_NULL | MAY_BE_FALSE),
+2 -3
View File
@@ -217,10 +217,9 @@ static zend_always_inline zend_bool zend_ssa_is_no_val_use(const zend_op *opline
if (opline->opcode == ZEND_ASSIGN || opline->opcode == ZEND_UNSET_CV) {
return ssa_op->op1_use == var && ssa_op->op2_use != var;
}
// TODO: Reenable this after changing the SSA structure.
/*if (opline->opcode == ZEND_FE_FETCH_R) {
if (opline->opcode == ZEND_FE_FETCH_R) {
return ssa_op->op2_use == var && ssa_op->op1_use != var;
}*/
}
if (ssa_op->result_use == var && opline->opcode != ZEND_ADD_ARRAY_ELEMENT) {
return ssa_op->op1_use != var && ssa_op->op2_use != var;
}
+4 -5
View File
@@ -23,7 +23,6 @@
#include "zend_shared_alloc.h"
#include "zend_accelerator_util_funcs.h"
#include "zend_execute.h"
#include "SAPI.h"
#include "tsrm_win32.h"
#include <winbase.h>
#include <process.h>
@@ -79,14 +78,14 @@ static void zend_win_error_message(int type, char *msg, int err)
static char *create_name_with_username(char *name)
{
static char newname[MAXPATHLEN + UNLEN + 4 + 1 + 32 + 21];
static char newname[MAXPATHLEN + UNLEN + 4 + 1 + 32];
char *uname;
uname = php_win32_get_username();
if (!uname) {
return NULL;
}
snprintf(newname, sizeof(newname) - 1, "%s@%s@%.20s@%.32s", name, uname, sapi_module.name, ZCG(system_id));
snprintf(newname, sizeof(newname) - 1, "%s@%s@%.32s", name, uname, ZCG(system_id));
free(uname);
@@ -95,7 +94,7 @@ static char *create_name_with_username(char *name)
static char *get_mmap_base_file(void)
{
static char windir[MAXPATHLEN+UNLEN + 3 + sizeof("\\\\@") + 1 + 32 + 21];
static char windir[MAXPATHLEN+UNLEN + 3 + sizeof("\\\\@") + 1 + 32];
char *uname;
int l;
@@ -108,7 +107,7 @@ static char *get_mmap_base_file(void)
if ('\\' == windir[l-1]) {
l--;
}
snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s@%.20s@%.32s", ACCEL_FILEMAP_BASE, uname, sapi_module.name, ZCG(system_id));
snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s@%.32s", ACCEL_FILEMAP_BASE, uname, ZCG(system_id));
free(uname);
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Incorrect DCE with FE_FETCH
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--FILE--
<?php
function test() {
$a = ["3"];
$x = 1;
foreach ($a as $x) {
$x = 2.0;
}
var_dump($x);
}
test();
?>
--EXPECT--
float(2)
+2
View File
@@ -4691,6 +4691,7 @@ PHP_FUNCTION(openssl_pkey_get_public)
RETURN_FALSE;
}
ZVAL_RES(return_value, res);
Z_ADDREF_P(return_value);
}
/* }}} */
@@ -4732,6 +4733,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
RETURN_FALSE;
}
ZVAL_RES(return_value, res);
Z_ADDREF_P(return_value);
}
/* }}} */
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #79145 (openssl memory leak)
--SKIPIF--
<?php
if (!extension_loaded('openssl')) die('skip openssl extension not available');
if (getenv('SKIP_SLOW_TESTS')) die('skip slow test');
?>
--FILE--
<?php
$b = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDaFhc31WeskqxwI+Si5R/fZrLK
pJOlABiI3RZfKCHJVrXl3IvcHDFM/BHKUJoSi/ee8GS9iw0G4Z1eCzJdthXxHARh
j85Q5OliVxOdB1LoTOsOmfFf/fdvpU3DsOWsDKlVrL41MHxXorwrwOiys/r/gv2d
C9C4JmhTOjBVAK8SewIDAQAC
-----END PUBLIC KEY-----';
$start = memory_get_usage(true);
for ($i = 0; $i < 100000; $i++) {
$a = openssl_get_publickey($b);
openssl_free_key($a);
}
$end = memory_get_usage(true);
var_dump($end <= 1.1 * $start);
?>
--EXPECT--
bool(true)
+2 -5
View File
@@ -1005,7 +1005,6 @@ PHP_FUNCTION(pcntl_signal)
zval *handle;
zend_long signo;
zend_bool restart_syscalls = 1;
char *error = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) {
return;
@@ -1044,15 +1043,13 @@ PHP_FUNCTION(pcntl_signal)
RETURN_TRUE;
}
if (!zend_is_callable_ex(handle, NULL, 0, NULL, NULL, &error)) {
if (!zend_is_callable(handle, 0, NULL)) {
zend_string *func_name = zend_get_callable_name(handle);
PCNTL_G(last_error) = EINVAL;
php_error_docref(NULL, E_WARNING, "Specified handler \"%s\" is not callable (%s)", ZSTR_VAL(func_name), error);
php_error_docref(NULL, E_WARNING, "%s is not a callable function name error", ZSTR_VAL(func_name));
zend_string_release_ex(func_name, 0);
efree(error);
RETURN_FALSE;
}
ZEND_ASSERT(!error);
/* Add the function name to our signal table */
handle = zend_hash_index_update(&PCNTL_G(php_signal_table), signo, handle);
+1 -1
View File
@@ -42,6 +42,6 @@ bool(false)
Warning: pcntl_signal(): Invalid signal %s
bool(false)
Warning: pcntl_signal(): Specified handler "not callable" is not callable (%s) in %s
Warning: pcntl_signal(): not callable is not a callable function name error in %s
bool(false)
ok
+1 -1
View File
@@ -4,7 +4,7 @@ ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no");
if (PHP_PDO_PGSQL != "no") {
if (CHECK_LIB("libpq.lib", "pdo_pgsql", PHP_PDO_PGSQL) &&
CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;")) {
CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;")) {
EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c");
if (CHECK_HEADER_ADD_INCLUDE("pg_config.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) {
+3 -11
View File
@@ -479,7 +479,7 @@ static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (!PQconsumeInput(H->server) || PQstatus(H->server) == CONNECTION_BAD) {
if (PQstatus(H->server) == CONNECTION_BAD) {
PQreset(H->server);
}
return (PQstatus(H->server) == CONNECTION_OK) ? SUCCESS : FAILURE;
@@ -1071,21 +1071,13 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (!PQconsumeInput(H->server)) {
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
PQconsumeInput(H->server);
pgsql_notify = PQnotifies(H->server);
if (ms_timeout && !pgsql_notify) {
php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, (int)ms_timeout);
if (!PQconsumeInput(H->server)) {
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
PQconsumeInput(H->server);
pgsql_notify = PQnotifies(H->server);
}
+6 -30
View File
@@ -1404,7 +1404,6 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
char *str_key;
zend_class_entry *ce = p_obj->c;
phar_archive_object *phar_obj = p_obj->p;
php_stream_statbuf ssb;
value = iter->funcs->get_current_data(iter);
@@ -1672,16 +1671,6 @@ after_open_fp:
php_stream_copy_to_stream_ex(fp, p_obj->fp, PHP_STREAM_COPY_ALL, &contents_len);
data->internal_file->uncompressed_filesize = data->internal_file->compressed_filesize =
php_stream_tell(p_obj->fp) - data->internal_file->offset;
if (php_stream_stat(fp, &ssb) != -1) {
data->internal_file->flags = ssb.sb.st_mode & PHAR_ENT_PERM_MASK ;
} else {
#ifndef _WIN32
mode_t mask;
mask = umask(0);
umask(mask);
data->internal_file->flags &= ~mask;
#endif
}
}
if (close_fp) {
@@ -4153,7 +4142,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
if ('\\' == filename[cnt]) {
filename[cnt] = '/';
}
} while (cnt++ < filename_len);
} while (cnt++ <= filename_len);
}
#endif
@@ -5022,7 +5011,6 @@ PHP_METHOD(PharFileInfo, compress)
PHP_METHOD(PharFileInfo, decompress)
{
char *error;
char *compression_type;
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
@@ -5073,24 +5061,12 @@ PHP_METHOD(PharFileInfo, decompress)
/* re-populate after copy-on-write */
entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
}
switch (entry_obj->entry->flags & PHAR_ENT_COMPRESSION_MASK) {
case PHAR_ENT_COMPRESSED_GZ:
compression_type = "gzip";
break;
case PHAR_ENT_COMPRESSED_BZ2:
compression_type = "bz2";
break;
default:
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress file compressed with unknown compression type");
if (!entry_obj->entry->fp) {
if (FAILURE == phar_open_archive_fp(entry_obj->entry->phar)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot decompress entry \"%s\", phar error: Cannot open phar archive \"%s\" for reading", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
/* decompress this file indirectly */
if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot decompress %s-compressed file \"%s\" in phar \"%s\": %s", compression_type, entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
}
entry_obj->entry->fp_type = PHAR_FP;
}
entry_obj->entry->old_flags = entry_obj->entry->flags;
-35
View File
@@ -1,35 +0,0 @@
--TEST--
Bug #76584 (PharFileInfo::decompress not working)
--SKIPIF--
<?php
if (!extension_loaded('phar')) die('skip phar extension not available');
if (!extension_loaded('zlib')) die('skip zlib extension not available');
?>
--INI--
phar.readonly=0
--FILE--
<?php
$phar = new Phar(__DIR__ . '/76584.phar');
$phar->addFromString('76584.txt', 'This is a test file.');
$file = $phar['76584.txt'];
var_dump($file->compress(Phar::GZ));
var_dump($file->isCompressed());
var_dump($file->decompress());
var_dump($file->isCompressed());
mkdir(__DIR__ . '/76584');
var_dump($phar->extractTo(__DIR__ . '/76584'));
echo file_get_contents(__DIR__ . '/76584/76584.txt');
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
This is a test file.
--CLEAN--
<?php
unlink(__DIR__ . '/76584/76584.txt');
rmdir(__DIR__ . '/76584');
unlink(__DIR__ . '/76584.phar');
?>
-52
View File
@@ -1,52 +0,0 @@
--TEST--
Phar: Bug #79082: Files added to tar with Phar::buildFromIterator have all-access permissions
--SKIPIF--
<?php
if (!extension_loaded("phar")) die("skip");
if (defined("PHP_WINDOWS_VERSION_MAJOR")) die("skip not for Windows")
?>
--FILE--
<?php
umask(022);
var_dump(decoct(umask()));
chmod(__DIR__ . '/test79082/test79082-testfile', 0644);
chmod(__DIR__ . '/test79082/test79082-testfile2', 0400);
foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) {
clearstatcache();
$phar = new PharData(__DIR__ . '/test79082.' . $ext, null, null, $mode);
$phar->buildFromIterator(new \RecursiveDirectoryIterator(__DIR__ . '/test79082', \FilesystemIterator::SKIP_DOTS), __DIR__ . '/test79082');
$phar->extractTo(__DIR__);
var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode']));
var_dump(decoct(stat(__DIR__ . '/test79082-testfile2')['mode']));
unlink(__DIR__ . '/test79082-testfile');
unlink(__DIR__ . '/test79082-testfile2');
}
foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) {
clearstatcache();
$phar = new PharData(__DIR__ . '/test79082-d.' . $ext, null, null, $mode);
$phar->buildFromDirectory(__DIR__ . '/test79082');
$phar->extractTo(__DIR__);
var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode']));
var_dump(decoct(stat(__DIR__ . '/test79082-testfile2')['mode']));
unlink(__DIR__ . '/test79082-testfile');
unlink(__DIR__ . '/test79082-testfile2');
}
?>
--CLEAN--
<?
unlink(__DIR__ . '/test79082.tar');
unlink(__DIR__ . '/test79082.zip');
unlink(__DIR__ . '/test79082-d.tar');
unlink(__DIR__ . '/test79082-d.zip');
?>
--EXPECT--
string(2) "22"
string(6) "100644"
string(6) "100400"
string(6) "100644"
string(6) "100400"
string(6) "100644"
string(6) "100400"
string(6) "100644"
string(6) "100400"
@@ -1 +0,0 @@
test
@@ -1 +0,0 @@
test
-2
View File
@@ -4588,8 +4588,6 @@ ZEND_METHOD(reflection_class, isCloneable)
if (UNEXPECTED(object_init_ex(&obj, ce) != SUCCESS)) {
return;
}
/* We're not calling the constructor, so don't call the destructor either. */
zend_object_store_ctor_failed(Z_OBJ(obj));
RETVAL_BOOL(Z_OBJ_HANDLER(obj, clone_obj) != NULL);
zval_ptr_dtor(&obj);
}
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #79115: ReflectionClass::isCloneable call reflected class __destruct
--FILE--
<?php
class A {
function __construct() { echo __FUNCTION__ . "\n"; }
function __destruct() { echo __FUNCTION__ . "\n"; }
}
$c = new ReflectionClass('A');
var_dump($c->isCloneable());
?>
--EXPECT--
bool(true)
+4 -7
View File
@@ -2287,7 +2287,6 @@ static PHP_FUNCTION(session_create_id)
/* Detect collision and retry */
if (PS(mod)->s_validate_sid(&PS(mod_data), new_id) == FAILURE) {
zend_string_release_ex(new_id, 0);
new_id = NULL;
continue;
}
break;
@@ -3308,12 +3307,10 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
if (PS(rfc1867_cleanup)) {
php_session_rfc1867_cleanup(progress);
} else {
if (!Z_ISUNDEF(progress->data)) {
SEPARATE_ARRAY(&progress->data);
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 1);
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
php_session_rfc1867_update(progress, 1);
}
SEPARATE_ARRAY(&progress->data);
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 1);
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
php_session_rfc1867_update(progress, 1);
}
php_rshutdown_session_globals();
}
-67
View File
@@ -1,67 +0,0 @@
--TEST--
Bug #79091 (heap use-after-free in session_create_id())
--SKIPIF--
<?php
if (!extension_loaded('session')) die('skip session extension not available');
?>
--FILE--
<?php
class MySessionHandler implements SessionHandlerInterface, SessionIdInterface, SessionUpdateTimestampHandlerInterface
{
public function close()
{
return true;
}
public function destroy($session_id)
{
return true;
}
public function gc($maxlifetime)
{
return true;
}
public function open($save_path, $session_name)
{
return true;
}
public function read($session_id)
{
return '';
}
public function write($session_id, $session_data)
{
return true;
}
public function create_sid()
{
return uniqid();
}
public function updateTimestamp($key, $val)
{
return true;
}
public function validateId($key)
{
return false;
}
}
ob_start();
var_dump(session_set_save_handler(new MySessionHandler()));
var_dump(session_start());
ob_flush();
session_create_id();
?>
--EXPECTF--
bool(true)
bool(true)
Warning: session_create_id(): Failed to create new ID in %s on line %d
-45
View File
@@ -1,45 +0,0 @@
--TEST--
Null Pointer Dereference in PHP Session Upload Progress
--INI--
error_reporting=0
file_uploads=1
upload_max_filesize=1024
session.save_path=
session.name=PHPSESSID
session.serialize_handler=php
session.use_strict_mode=0
session.use_cookies=1
session.use_only_cookies=0
session.upload_progress.enabled=1
session.upload_progress.cleanup=0
session.upload_progress.prefix=upload_progress_
session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.freq=1%
session.upload_progress.min_freq=0.000000001
--COOKIE--
PHPSESSID=session-upload
--POST_RAW--
Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; name="PHPSESSID"
session-upload
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"
ryat
-----------------------------20896060251896012921717172737
Content-Disposition: form-data; file="file"; ryat="filename"
1
-----------------------------20896060251896012921717172737--
--FILE--
<?php
session_start();
var_dump($_SESSION);
session_destroy();
--EXPECTF--
array(0) {
}
-1
View File
@@ -3,7 +3,6 @@ Bug #76348 (WSDL_CACHE_MEMORY causes Segmentation fault)
--SKIPIF--
<?php
if (!extension_loaded('soap')) die('skip soap extension not available');
if (getenv('SKIP_ONLINE_TESTS')) die('skip online test');
?>
--FILE--
<?php
+4 -4
View File
@@ -2,12 +2,12 @@
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://example.x-road.eu/producer/"
xmlns:tns="http://example.x-road.ee/producer/"
xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"
targetNamespace="http://example.x-road.eu/producer/">
targetNamespace="http://example.x-road.ee/producer/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.x-road.eu/producer/">
<import namespace="http://x-road.eu/xsd/x-road.xsd" schemaLocation="bug76348.xsd"/>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.x-road.ee/producer/">
<import namespace="http://x-road.ee/xsd/x-road.xsd" schemaLocation="http://x-road.ee/xsd/x-road.xsd"/>
<import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
<element name="exampleOperation">
-641
View File
@@ -1,641 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
X-road EU namespace: http://x-road.eu/xsd/x-road.xsd
03.04.2012: added xml:lang attributes to <xrd:title> elements
28.03.2013: improved language usage
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xrd="http://x-road.eu/xsd/x-road.xsd" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://x-road.eu/xsd/x-road.xsd">
<!-- prefiks xml -->
<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2009/01/xml.xsd" />
<!-- header elements an types -->
<complexType name="hdrstd">
<sequence>
<element ref="xrd:consumer" />
<element ref="xrd:producer" />
<element ref="xrd:userId" />
<element ref="xrd:id" />
<element ref="xrd:service" />
<element ref="xrd:issue" />
</sequence>
</complexType>
<element name="consumer" type="string">
<annotation>
<documentation>Service consumer code</documentation>
</annotation>
</element>
<element name="producer" type="string">
<annotation>
<documentation>Service producer code</documentation>
</annotation>
</element>
<element name="userId" type="string">
<annotation>
<documentation>Service user identification code with country code prefix (2-characters)</documentation>
</annotation>
</element>
<element name="id" type="string">
<annotation>
<documentation>Query id</documentation>
</annotation>
</element>
<element name="service" type="string">
<annotation>
<documentation>Query name</documentation>
</annotation>
</element>
<element name="issue" type="string">
<annotation>
<documentation>Query issue</documentation>
</annotation>
</element>
<element name="unit" type="string">
<annotation>
<documentation>Service user's unit code</documentation>
</annotation>
</element>
<element name="position" type="string">
<annotation>
<documentation>Service user postition name</documentation>
</annotation>
</element>
<element name="authenticator" type="string">
<annotation>
<documentation>Service user's authenticator</documentation>
</annotation>
</element>
<element name="userName" type="string">
<annotation>
<documentation>Service user full name</documentation>
</annotation>
</element>
<element name="async" type="boolean">
<annotation>
<documentation>Asynchroneous service flag</documentation>
</annotation>
</element>
<element name="encode" type="string">
<annotation>
<documentation>Name of encoder-db</documentation>
</annotation>
</element>
<!-- Elements describing other elements and operations-->
<element name="title">
<annotation>
<documentation>Title</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="string">
<attribute ref="xml:lang" default="en" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="notes">
<annotation>
<documentation>Notes for user</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="string">
<attribute ref="xml:lang" default="en" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="technotes">
<annotation>
<documentation>Notes for technical stuff</documentation>
</annotation>
<complexType>
<simpleContent>
<extension base="string">
<attribute ref="xml:lang" default="en" />
</extension>
</simpleContent>
</complexType>
</element>
<element name="ref" type="string">
<annotation>
<documentation>The element name of the element is associated</documentation>
</annotation>
</element>
<element name="wildcard">
<annotation>
<documentation>List of permitted wildcards</documentation>
</annotation>
<simpleType>
<restriction base="string">
<pattern value="[*?-PS]+" />
</restriction>
</simpleType>
</element>
<element name="version">
<annotation>
<documentation>Version</documentation>
</annotation>
<simpleType>
<restriction base="string">
<pattern value="v\d+" />
</restriction>
</simpleType>
</element>
<element name="nocontent" type="string">
<annotation>
<documentation>Meaning of empty fields</documentation>
</annotation>
</element>
<element name="requirecontent" type="string">
<annotation>
<documentation>Meaning of empty fields</documentation>
</annotation>
</element>
<element name="address">
<annotation>
<documentation>Port address</documentation>
</annotation>
<complexType>
<attribute name="producer" type="string" />
</complexType>
</element>
<complexType name="legacy_response">
<sequence>
<element name="url" type="xrd:url">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Infosüsteemi sissepääsu URL</xrd:title>
<xrd:title xml:lang="en">URL for entering external portal</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
<!-- Mittetehniline veateade -->
<complexType name="invalidInput">
<sequence>
<element name="faultCode" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Kood</xrd:title>
<xrd:title xml:lang="en">Code</xrd:title>
</appinfo>
</annotation>
</element>
<element name="faultString" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Teade</xrd:title>
<xrd:title xml:lang="en">Error message</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
<!-- Tüübid -->
<simpleType name="jpg">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Pilt (JPEG)</xrd:title>
<xrd:title xml:lang="en">JPEG picture</xrd:title>
</appinfo>
</annotation>
<restriction base="base64Binary" />
</simpleType>
<simpleType name="gif">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Pilt (GIF)</xrd:title>
<xrd:title xml:lang="en">GIF picture</xrd:title>
</appinfo>
</annotation>
<restriction base="base64Binary" />
</simpleType>
<simpleType name="xml">
<annotation>
<appinfo>
<xrd:title xml:lang="et">XMLina kasutatav tekst</xrd:title>
<xrd:title xml:lang="en">Text as XML</xrd:title>
</appinfo>
</annotation>
<restriction base="string" />
</simpleType>
<simpleType name="txt">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Tekstifail</xrd:title>
<xrd:title xml:lang="en">Text file</xrd:title>
</appinfo>
</annotation>
<restriction base="string" />
</simpleType>
<simpleType name="csv">
<annotation>
<appinfo>
<xrd:title xml:lang="et">CSV-vormingus fail</xrd:title>
<xrd:title xml:lang="en">CSV file</xrd:title>
</appinfo>
</annotation>
<restriction base="string" />
</simpleType>
<simpleType name="maakond">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Maakond</xrd:title>
<xrd:title xml:lang="en">County</xrd:title>
<xrd:technotes>County code in Estonian Administrative and Settlement Classification (EHAK)</xrd:technotes>
</appinfo>
</annotation>
<restriction base="string">
<pattern value="\d{4}" />
</restriction>
</simpleType>
<simpleType name="vald">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Vald</xrd:title>
<xrd:title xml:lang="en">Parish</xrd:title>
<xrd:technotes>Parish code in Estonian Administrative and Settlement Classification (EHAK)</xrd:technotes>
</appinfo>
</annotation>
<restriction base="string">
<pattern value="\d{4}" />
</restriction>
</simpleType>
<simpleType name="asula">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Asula</xrd:title>
<xrd:title xml:lang="en">Village</xrd:title>
<xrd:technotes>Village code in Estonian Administrative and Settlement Classification (EHAK)</xrd:technotes>
</appinfo>
</annotation>
<restriction base="string">
<pattern value="\d{4}" />
</restriction>
</simpleType>
<simpleType name="ehak">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Haldusüksus</xrd:title>
<xrd:title xml:lang="en">Unit</xrd:title>
<xrd:technotes>Unit code in Estonian Administrative and Settlement Classification (EHAK). Could be County, Parish or Village</xrd:technotes>
</appinfo>
</annotation>
<restriction base="string">
<pattern value="\d{4}" />
</restriction>
</simpleType>
<simpleType name="url">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Link</xrd:title>
<xrd:title xml:lang="en">Link</xrd:title>
<xrd:technotes>WWW URL</xrd:technotes>
</appinfo>
</annotation>
<restriction base="anyURI" />
</simpleType>
<complexType name="ArrayOfString">
<sequence>
<element name="item" type="string" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
<attribute name="sensitive" type="boolean" />
<!--listMethods - meta-service for db adapter: returns list of all implemented queries-->
<element name="listMethods" nillable="true" />
<element name="listMethodsResponse">
<complexType>
<sequence>
<element name="response">
<complexType>
<sequence>
<element name="item" type="string" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<!--testSystem - meta-service for db adapter: checks system status -->
<element name="testSystem" nillable="true" />
<element name="testSystemResponse" nillable="true" />
<!-- unitValid (service for xroad portal), checks if the unit is valid at the current moment-->
<complexType name="unitValid">
<sequence>
<element name="request">
<complexType>
<sequence>
<element name="unitCode" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Üksuse kood</xrd:title>
<xrd:title xml:lang="en">Unit code</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<complexType name="unitValidResponse">
<sequence>
<element name="request">
<complexType>
<sequence>
<element name="unitCode" type="string" />
</sequence>
</complexType>
</element>
<element name="response">
<complexType>
<all>
<element name="isValid" type="boolean">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Kas üksus kehtib</xrd:title>
<xrd:title xml:lang="en">Is unit valid at the moment</xrd:title>
</appinfo>
</annotation>
</element>
<element name="name" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Üksuse nimi</xrd:title>
<xrd:title xml:lang="en">Unit name</xrd:title>
</appinfo>
</annotation>
</element>
</all>
</complexType>
</element>
</sequence>
</complexType>
<!--unitRepresent (service for xroad portal) returns units, the person is allowed to represent -->
<complexType name="unitRepresent">
<sequence>
<element name="request">
<complexType>
<sequence>
<element name="personCode" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Isikukood</xrd:title>
<xrd:title xml:lang="en">Person SSN</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<complexType name="unitRepresentResponse">
<sequence>
<element name="request">
<complexType>
<sequence>
<element name="personCode" type="string" />
</sequence>
</complexType>
</element>
<element name="response">
<complexType>
<sequence>
<element name="item" minOccurs="0" maxOccurs="unbounded">
<complexType>
<all>
<element name="unitCode" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Üksuse kood</xrd:title>
<xrd:title xml:lang="en">Unit code</xrd:title>
</appinfo>
</annotation>
</element>
<element name="name" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Üksuse nimi</xrd:title>
<xrd:title xml:lang="en">Unit name</xrd:title>
</appinfo>
</annotation>
</element>
</all>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<!-- query for loading classifications to X-road portal-->
<element name="loadClassification">
<complexType>
<sequence>
<element name="request" nillable="true">
<complexType>
<sequence>
<element name="name" type="string" nillable="true">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Nimi</xrd:title>
<xrd:title xml:lang="en">Name</xrd:title>
</appinfo>
</annotation>
</element>
<element name="subset" type="string" nillable="true">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Alamhulk</xrd:title>
<xrd:title xml:lang="en">Subset</xrd:title>
</appinfo>
</annotation>
</element>
<element name="from" type="date" nillable="true">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Alates</xrd:title>
<xrd:title xml:lang="en">From</xrd:title>
</appinfo>
</annotation>
</element>
<element name="max" type="string" nillable="true">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Maksimaalne arv</xrd:title>
<xrd:title xml:lang="en">Max count</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="loadClassificationResponse">
<complexType>
<sequence>
<element name="request" nillable="true">
<complexType>
<sequence>
<element name="name" type="string" nillable="true" />
<element name="subset" type="string" nillable="true" />
<element name="from" type="date" nillable="true" />
<element name="max" type="string" nillable="true" />
</sequence>
</complexType>
</element>
<element name="response">
<complexType>
<sequence>
<element name="classificationNames" nillable="true">
<complexType>
<sequence>
<element name="item" type="string" minOccurs="0" maxOccurs="unbounded">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Nimi</xrd:title>
<xrd:title xml:lang="en">Name</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
</element>
<element name="classifications" nillable="true">
<complexType>
<sequence>
<any minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
</element>
<element name="faultCode" type="xrd:faultCode" nillable="true" />
<element name="faultString" type="xrd:faultString" nillable="true" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<!-- userAllowedMethods service returns user permissions from X-road portal -->
<element name="userAllowedMethods">
<complexType>
<sequence>
<element name="request">
<complexType>
<sequence>
<element name="personCode" type="string" nillable="true">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Isikukood</xrd:title>
<xrd:title xml:lang="en">Person SSN</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="userAllowedMethodsResponse">
<complexType>
<sequence>
<element name="request" nillable="true">
<complexType>
<sequence>
<element name="personCode" type="string" nillable="true" />
</sequence>
</complexType>
</element>
<element name="response">
<complexType>
<sequence>
<element name="person" nillable="true" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="personCode" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Isikukood</xrd:title>
<xrd:title xml:lang="en">Person identification code</xrd:title>
</appinfo>
</annotation>
</element>
<element name="orgQuery" nillable="true" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="orgCode" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Asutuse kood</xrd:title>
<xrd:title xml:lang="en">Organization code</xrd:title>
</appinfo>
</annotation>
</element>
<element name="orgName" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Asutuse nimi</xrd:title>
<xrd:title xml:lang="en">Organization name</xrd:title>
</appinfo>
</annotation>
</element>
<element name="query" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="queryName" type="string">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Päringu nimi</xrd:title>
<xrd:title xml:lang="en">Query name</xrd:title>
</appinfo>
</annotation>
</element>
<element name="validUntil" type="date" nillable="true">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Kehtib kuupäevani</xrd:title>
<xrd:title xml:lang="en">Permission valid until date</xrd:title>
</appinfo>
</annotation>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="faultCode" type="xrd:faultCode" nillable="true" />
<element name="faultString" type="xrd:faultString" nillable="true" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<!-- Non-technical error -->
<simpleType name="faultCode">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Kood</xrd:title>
<xrd:title xml:lang="en">Code</xrd:title>
</appinfo>
</annotation>
<restriction base="string" />
</simpleType>
<simpleType name="faultString">
<annotation>
<appinfo>
<xrd:title xml:lang="et">Teade</xrd:title>
<xrd:title xml:lang="en">Error message</xrd:title>
</appinfo>
</annotation>
<restriction base="string" />
</simpleType>
</schema>
-2
View File
@@ -257,7 +257,6 @@ static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret) /* {{{ */
llist->count--;
ZVAL_COPY(ret, &tail->data);
tail->prev = NULL;
if (llist->dtor) {
llist->dtor(tail);
}
@@ -311,7 +310,6 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret) /* {{{ */
llist->count--;
ZVAL_COPY(ret, &head->data);
head->next = NULL;
if (llist->dtor) {
llist->dtor(head);
}
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #79151: heap use after free caused by spl_dllist_it_helper_move_forward
--FILE--
<?php
$a = new SplDoublyLinkedList();
$a->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_DELETE);
$a->push(1);
$a->rewind();
$a->unshift(2);
var_dump($a->pop());
var_dump($a->next());
$a = new SplDoublyLinkedList();
$a->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_DELETE);
$a->unshift(1);
$a->rewind();
$a->push(2);
var_dump($a->shift());
var_dump($a->next());
?>
--EXPECT--
int(1)
NULL
int(1)
NULL
+1 -1
View File
@@ -4478,7 +4478,7 @@ PHP_FUNCTION(getopt)
while ((o = php_getopt(argc, argv, opts, &php_optarg, &php_optind, 0, 1)) != -1) {
/* Skip unknown arguments. */
if (o == PHP_GETOPT_INVALID_ARG) {
if (o == '?') {
continue;
}
+1 -1
View File
@@ -372,7 +372,7 @@ PHP_FUNCTION(mail)
extra_cmd = php_escape_shell_cmd(ZSTR_VAL(extra_cmd));
}
if (php_mail(to_r, subject_r, message, str_headers && ZSTR_LEN(str_headers) ? ZSTR_VAL(str_headers) : NULL, extra_cmd ? ZSTR_VAL(extra_cmd) : NULL)) {
if (php_mail(to_r, subject_r, message, str_headers ? ZSTR_VAL(str_headers) : NULL, extra_cmd ? ZSTR_VAL(extra_cmd) : NULL)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
+5 -5
View File
@@ -5164,7 +5164,7 @@ state_1:
}
lc = '>';
if (is_xml && p >= buf + 1 && *(p -1) == '-') {
if (is_xml && *(p -1) == '-') {
break;
}
in_q = state = is_xml = 0;
@@ -5196,7 +5196,7 @@ state_1:
goto reg_char_1;
case '!':
/* JavaScript & Other HTML scripting languages */
if (p >= buf + 1 && *(p-1) == '<') {
if (*(p-1) == '<') {
state = 3;
lc = c;
p++;
@@ -5206,7 +5206,7 @@ state_1:
}
break;
case '?':
if (p >= buf + 1 && *(p-1) == '<') {
if (*(p-1) == '<') {
br=0;
state = 2;
p++;
@@ -5257,7 +5257,7 @@ state_2:
break;
}
if (!br && p >= buf + 1 && lc != '\"' && *(p-1) == '?') {
if (!br && lc != '\"' && *(p-1) == '?') {
in_q = state = 0;
tp = tbuf;
p++;
@@ -5266,7 +5266,7 @@ state_2:
break;
case '"':
case '\'':
if (p >= buf + 1 && *(p-1) != '\\') {
if (*(p-1) != '\\') {
if (lc == c) {
lc = '\0';
} else if (lc != '\\') {
-32
View File
@@ -1,32 +0,0 @@
--TEST--
Bug #79099 (OOB read in php_strip_tags_ex)
--FILE--
<?php
$stream = fopen('php://memory', 'w+');
fputs($stream, "<?\n\"\n");
rewind($stream);
var_dump(@fgetss($stream));
var_dump(@fgetss($stream));
fclose($stream);
$stream = fopen('php://memory', 'w+');
fputs($stream, "<\0\n!\n");
rewind($stream);
var_dump(@fgetss($stream));
var_dump(@fgetss($stream));
fclose($stream);
$stream = fopen('php://memory', 'w+');
fputs($stream, "<\0\n?\n");
rewind($stream);
var_dump(@fgetss($stream));
var_dump(@fgetss($stream));
fclose($stream);
?>
--EXPECT--
string(0) ""
string(0) ""
string(0) ""
string(0) ""
string(0) ""
string(0) ""
@@ -1,10 +0,0 @@
--TEST--
Ini parsing errors should not result in memory leaks
--FILE--
<?php
var_dump(parse_ini_string('a="b'));
?>
--EXPECTF--
Warning: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in Unknown on line 1
in %s on line %d
bool(false)
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #54298 (Using empty additional_headers adding extraneous CRLF)
--INI--
sendmail_path=tee bug54298.eml >/dev/null
mail.add_x_header = Off
--SKIPIF--
<?php
if (PHP_OS_FAMILY === 'Windows') die("skip Won't run on Windows");
?>
--FILE--
<?php
var_dump(mail('someuser@example.com', 'testsubj', 'Body part', ''));
echo file_get_contents('bug54298.eml');
?>
--EXPECT--
bool(true)
To: someuser@example.com
Subject: testsubj
Body part
--CLEAN--
<?php
unlink('bug54298.eml');
?>
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #78902: Memory leak when using stream_filter_append
--INI--
memory_limit=512k
--FILE--
<?php
/** create temporary file 2mb file */
$tmp_file_name = tempnam(sys_get_temp_dir(), 'test_');
$fp = fopen($tmp_file_name, 'w+');
$size = 1024 * 1024 * 2; // 2mb
$chunk = 1024;
while ($size > 0) {
fputs($fp, str_pad('', min($chunk,$size)));
$size -= $chunk;
}
fclose($fp);
$fp = fopen($tmp_file_name, 'r');
stream_filter_append($fp, "string.toupper");
while (!feof($fp)) {
fread($fp, 1);
}
fclose($fp);
var_dump(true);
?>
--EXPECT--
bool(true)
+7 -16
View File
@@ -118,25 +118,17 @@ static void xmlwriter_free_resource_ptr(xmlwriter_object *intern)
static zend_object_handlers xmlwriter_object_handlers;
/* {{{{ xmlwriter_object_dtor */
static void xmlwriter_object_dtor(zend_object *object)
{
ze_xmlwriter_object *intern = php_xmlwriter_fetch_object(object);
/* freeing the resource here may leak, but otherwise we may use it after it has been freed */
if (intern->xmlwriter_ptr) {
xmlwriter_free_resource_ptr(intern->xmlwriter_ptr);
}
intern->xmlwriter_ptr = NULL;
zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ xmlwriter_object_free_storage */
static void xmlwriter_object_free_storage(zend_object *object)
{
ze_xmlwriter_object *intern = php_xmlwriter_fetch_object(object);
if (!intern) {
return;
}
if (intern->xmlwriter_ptr) {
xmlwriter_free_resource_ptr(intern->xmlwriter_ptr);
}
intern->xmlwriter_ptr = NULL;
zend_object_std_dtor(&intern->std);
}
/* }}} */
@@ -1850,7 +1842,6 @@ static PHP_MINIT_FUNCTION(xmlwriter)
memcpy(&xmlwriter_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
xmlwriter_object_handlers.offset = XtOffsetOf(ze_xmlwriter_object, std);
xmlwriter_object_handlers.dtor_obj = xmlwriter_object_dtor;
xmlwriter_object_handlers.free_obj = xmlwriter_object_free_storage;
xmlwriter_object_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "XMLWriter", xmlwriter_class_functions);
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #71536 (Access Violation crashes php-cgi.exe)
--SKIPIF--
<?php
if (!extension_loaded('xmlwriter')) die('skip xmlwriter extension not available');
?>
--FILE--
<?php
class Test {
public static function init()
{
$xml = new \XMLWriter();
$xml->openUri('php://memory');
$xml->setIndent(false);
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('response');
die('now'); // crashed with die()
}
}
Test::init();
?>
--EXPECT--
now
-34
View File
@@ -1,34 +0,0 @@
--TEST--
#79029 (Use After Free's in XMLReader / XMLWriter)
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) print "skip xmlwriter extension not available";
if (!extension_loaded("xmlreader")) print "skip xmlreader extension not available";
?>
--FILE--
<?php
$x = array( new XMLWriter() );
$x[0]->openUri("bug79029_1.txt");
$x[0]->startComment();
$y = new XMLWriter();
$y->openUri("bug79029_2.txt");
fclose(@end(get_resources()));
file_put_contents("bug79029_3.txt", "a");
$z = new XMLReader();
$z->open("bug79029_3.txt");
fclose(@end(get_resources()));
?>
okey
--CLEAN--
<?php
@unlink("bug79029_1.txt");
@unlink("bug79029_2.txt");
@unlink("bug79029_3.txt");
?>
--EXPECTF--
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
Warning: fclose(): %d is not a valid stream resource in %sbug79029.php on line %d
okey
-51
View File
@@ -1,51 +0,0 @@
--TEST--
Bug #70078 (XSL callbacks with nodes as parameter leak memory)
--SKIPIF--
<?php
if (!extension_loaded('xsl')) die('skip xsl extension not available');
?>
--FILE--
<?php
// create big dummy document:
$dom = new \DOMDocument();
$rootNode = $dom->appendChild($dom->createElement('root'));
for ($i = 0; $i <= 100; $i++) {
$level1Node = $rootNode->appendChild($dom->createElement('level1'));
for ($j = 0; $j <= 100; $j++) {
$level2Node = $level1Node->appendChild($dom->createElement('level2'));
for ($k = 0; $k <= 10; $k++) {
$level3Node = $level2Node->appendChild($dom->createElement('level3', 'test'));
}
}
}
function testPhpFunction($node) {
return 'test2';
}
$xslStr = <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl">
<xsl:template match="root">
<output>
<xsl:for-each select="level1">
<node>
<xsl:value-of select="php:function('testPhpFunction', .)" />
</node>
</xsl:for-each>
</output>
</xsl:template>
</xsl:stylesheet>
EOF;
$xsl = new \DOMDocument();
$xsl->loadXML($xslStr);
$xslt = new \XSLTProcessor();
$xslt->registerPHPFunctions('testPhpFunction');
$xslt->importStyleSheet($xsl);
echo $xslt->transformToXML($dom);
?>
--EXPECT--
<?xml version="1.0"?>
<output xmlns:php="http://php.net/xsl"><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node><node>test2</node></output>
+1 -1
View File
@@ -274,7 +274,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
node->parent = nsparent;
node->ns = curns;
} else {
node = xmlDocCopyNode(node, domintern->document->ptr, 1);
node = xmlDocCopyNodeList(domintern->document->ptr, node);
}
php_dom_create_object(node, &child, domintern);
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff. Show more