mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Use __DIR__-relative path in tests Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c
This commit is contained in:
commit
c83632a503
5 changed files with 40 additions and 3 deletions
3
NEWS
3
NEWS
|
@ -8,6 +8,9 @@ PHP NEWS
|
|||
- PCRE:
|
||||
. Fixed bug GH-12628 (The gh11374 test fails on Alpinelinux). (nielsdos)
|
||||
|
||||
- PHPDBG:
|
||||
. Fixed bug GH-12675 (MEMORY_LEAK in phpdbg_prompt.c). (nielsdos)
|
||||
|
||||
- Standard:
|
||||
. Fix memory leak in syslog device handling. (danog)
|
||||
. Fixed bug GH-12621 (browscap segmentation fault when configured in the
|
||||
|
|
|
@ -4,7 +4,7 @@ Bug #78793: Use-after-free in exif parsing under memory sanitizer
|
|||
exif
|
||||
--FILE--
|
||||
<?php
|
||||
$f = "ext/exif/tests/bug77950.tiff";
|
||||
$f = __DIR__ . "/bug77950.tiff";
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
@exif_read_data($f);
|
||||
}
|
||||
|
|
|
@ -7,11 +7,11 @@ soap
|
|||
$options = array("cache_wsdl" => WSDL_CACHE_NONE);
|
||||
// Need a warm-up for globals
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$client = new SoapClient("ext/soap/tests/test.wsdl", $options);
|
||||
$client = new SoapClient(__DIR__ . "/test.wsdl", $options);
|
||||
}
|
||||
$usage = memory_get_usage();
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$client = new SoapClient("ext/soap/tests/test.wsdl", $options);
|
||||
$client = new SoapClient(__DIR__ . "/test.wsdl", $options);
|
||||
}
|
||||
$usage_delta = memory_get_usage() - $usage;
|
||||
var_dump($usage_delta);
|
||||
|
|
|
@ -407,6 +407,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
|
|||
if ((res_len != PHPDBG_G(exec_len)) || (memcmp(res, PHPDBG_G(exec), res_len) != SUCCESS)) {
|
||||
if (PHPDBG_G(in_execution)) {
|
||||
if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?") == FAILURE) {
|
||||
free(res);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -440,6 +441,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
|
|||
|
||||
phpdbg_compile();
|
||||
} else {
|
||||
free(res);
|
||||
phpdbg_notice("Execution context not changed");
|
||||
}
|
||||
} else {
|
||||
|
|
32
sapi/phpdbg/tests/gh12675.phpt
Normal file
32
sapi/phpdbg/tests/gh12675.phpt
Normal file
|
@ -0,0 +1,32 @@
|
|||
--TEST--
|
||||
GH-12675 (MEMORY_LEAK in phpdbg_prompt.c)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--PHPDBG--
|
||||
ev file_put_contents("gh12675_1.tmp", "<?php echo 'hi';\necho 2;")
|
||||
ev file_put_contents("gh12675_2.tmp", "<?php echo 'hi';")
|
||||
exec nonexistent.php
|
||||
exec gh12675_1.tmp
|
||||
exec gh12675_1.tmp
|
||||
b gh12675_1.tmp:2
|
||||
r
|
||||
exec gh12675_2.tmp
|
||||
n
|
||||
q
|
||||
--EXPECTF--
|
||||
prompt> 24
|
||||
prompt> 16
|
||||
prompt> [Cannot stat nonexistent.php, ensure the file exists]
|
||||
prompt> [Set execution context: %sgh12675_1.tmp]
|
||||
[Successful compilation of %sgh12675_1.tmp]
|
||||
prompt> [Execution context not changed]
|
||||
prompt> [Breakpoint #0 added at %sgh12675_1.tmp:2]
|
||||
prompt> hi
|
||||
[Breakpoint #0 at %sgh12675_1.tmp:2, hits: 1]
|
||||
>00002: echo 2;
|
||||
prompt> Do you really want to stop execution to set a new execution context? (type y or n): prompt>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink("gh12675_1.tmp");
|
||||
@unlink("gh12675_2.tmp");
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue