File tree 4 files changed +37
-3
lines changed
4 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Bug #78793: Use-after-free in exif parsing under memory sanitizer
4
4
exif
5
5
--FILE--
6
6
<?php
7
- $ f = " ext/exif/tests /bug77950.tiff " ;
7
+ $ f = __DIR__ . " /bug77950.tiff " ;
8
8
for ($ i = 0 ; $ i < 10 ; $ i ++) {
9
9
@exif_read_data ($ f );
10
10
}
Original file line number Diff line number Diff line change 7
7
$ options = array ("cache_wsdl " => WSDL_CACHE_NONE );
8
8
// Need a warm-up for globals
9
9
for ($ i = 0 ; $ i < 10 ; $ i ++) {
10
- $ client = new SoapClient (" ext/soap/tests /test.wsdl " , $ options );
10
+ $ client = new SoapClient (__DIR__ . " /test.wsdl " , $ options );
11
11
}
12
12
$ usage = memory_get_usage ();
13
13
for ($ i = 0 ; $ i < 10 ; $ i ++) {
14
- $ client = new SoapClient (" ext/soap/tests /test.wsdl " , $ options );
14
+ $ client = new SoapClient (__DIR__ . " /test.wsdl " , $ options );
15
15
}
16
16
$ usage_delta = memory_get_usage () - $ usage ;
17
17
var_dump ($ usage_delta );
Original file line number Diff line number Diff line change @@ -407,6 +407,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
407
407
if ((res_len != PHPDBG_G (exec_len )) || (memcmp (res , PHPDBG_G (exec ), res_len ) != SUCCESS )) {
408
408
if (PHPDBG_G (in_execution )) {
409
409
if (phpdbg_ask_user_permission ("Do you really want to stop execution to set a new execution context?" ) == FAILURE ) {
410
+ free (res );
410
411
return FAILURE ;
411
412
}
412
413
}
@@ -440,6 +441,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
440
441
441
442
phpdbg_compile ();
442
443
} else {
444
+ free (res );
443
445
phpdbg_notice ("Execution context not changed" );
444
446
}
445
447
} else {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-12675 (MEMORY_LEAK in phpdbg_prompt.c)
3
+ --INI--
4
+ opcache.enable=0
5
+ --PHPDBG--
6
+ ev file_put_contents("gh12675_1.tmp", "<?php echo 'hi ' ;\necho 2 ;")
7
+ ev file_put_contents( " gh12675_2.tmp", "<?php echo 'hi'; " )
8
+ exec nonexistent.php
9
+ exec gh12675_1.tmp
10
+ exec gh12675_1.tmp
11
+ b gh12675_1.tmp:2
12
+ r
13
+ exec gh12675_2.tmp
14
+ n
15
+ q
16
+ --EXPECTF --
17
+ prompt> 24
18
+ prompt> 16
19
+ prompt> [Cannot stat nonexistent.php, ensure the file exists]
20
+ prompt> [Set execution context: %sgh12675_1.tmp]
21
+ [Successful compilation of %sgh12675_1.tmp]
22
+ prompt> [Execution context not changed]
23
+ prompt> [Breakpoint #0 added at %sgh12675_1.tmp:2]
24
+ prompt> hi
25
+ [Breakpoint #0 at %sgh12675_1.tmp:2, hits: 1]
26
+ >00002 : echo 2 ;
27
+ prompt> Do you really want to stop execution to set a new execution context? (type y or n): prompt>
28
+ --CLEAN --
29
+ <?php
30
+ @unlink ("gh12675_1.tmp " );
31
+ @unlink ("gh12675_2.tmp " );
32
+ ?>
You can’t perform that action at this time.
0 commit comments