File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ void *phpdbg_watchpoint_userfaultfd_thread(void *phpdbg_globals) {
316
316
317
317
struct uffd_msg fault_msg = {0 };
318
318
while (read (globals -> watch_userfaultfd , & fault_msg , sizeof (fault_msg )) == sizeof (fault_msg )) {
319
- void * page = phpdbg_get_page_boundary ((char * )(uintptr_t ) fault_msg .arg .pagefault .address );
319
+ void * page = phpdbg_get_page_boundary ((char * )(uintptr_t ) fault_msg .arg .pagefault .address );
320
320
zend_hash_index_add_empty_element (globals -> watchlist_mem , (zend_ulong ) page );
321
321
struct uffdio_writeprotect unprotect = {
322
322
.mode = 0 ,
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ phpdbg_watch null pointer access
3
+ --CREDITS--
4
+ Yuancheng Jiang
5
+ --SKIPIF--
6
+ <?php
7
+ if (getenv ('SKIP_ASAN ' )) {
8
+ die ("skip intentionally causes segfaults " );
9
+ }
10
+ ?>
11
+ --FILE--
12
+ <?php
13
+ echo "*** Testing array_multisort() : Testing with anonymous arguments *** \n" ;
14
+ var_dump (array_multisort (array (1 ,3 ,2 ,4 )));
15
+ $ xconnect =$ GLOBALS [array_rand ($ GLOBALS )];
16
+ echo "Done \n" ;
17
+ $ a = [];
18
+ $ a [0 ] = 1 ;
19
+ $ a [0 ] = 2 ;
20
+ $ a = [0 => 3 , 1 => 4 ];
21
+ ?>
22
+ --PHPDBG--
23
+ b 6
24
+ r
25
+ w a $a
26
+ c
27
+ q
28
+ --EXPECTF--
29
+ [Successful compilation of %s]
30
+ prompt> [Breakpoint #0 added at %s:%d]
31
+ prompt> *** Testing array_multisort() : Testing with anonymous arguments ***
32
+ bool(true)
33
+ Done
34
+ [Breakpoint #0 at %s:%d, hits: 1]
35
+ >00006: $a = [];
36
+ 00007: $a[0] = 1;
37
+ 00008: $a[0] = 2;
38
+ prompt> prompt> [Script ended normally]
39
+ prompt>
You can’t perform that action at this time.
0 commit comments