File tree Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ PHP NEWS
45
45
- PHPDBG:
46
46
. Fixed bug GH-13199 (EOF emits redundant prompt in phpdbg local console mode
47
47
with libedit/readline). (Peter Kokot)
48
+ . Fixed bug GH-15268 (heap buffer overflow in phpdbg
49
+ (zend_hash_num_elements() Zend/zend_hash.h)). (nielsdos)
48
50
49
51
- Soap:
50
52
. Fixed bug #55639 (Digest autentication dont work). (nielsdos)
Original file line number Diff line number Diff line change @@ -403,12 +403,15 @@ PHPDBG_INFO(classes) /* {{{ */
403
403
phpdbg_print_class_name (ce );
404
404
405
405
if (ce -> parent ) {
406
- zend_class_entry * pce ;
407
- pce = ce -> parent ;
408
- do {
409
- phpdbg_out ("|-------- " );
410
- phpdbg_print_class_name (pce );
411
- } while ((pce = pce -> parent ));
406
+ if (ce -> ce_flags & ZEND_ACC_LINKED ) {
407
+ zend_class_entry * pce = ce -> parent ;
408
+ do {
409
+ phpdbg_out ("|-------- " );
410
+ phpdbg_print_class_name (pce );
411
+ } while ((pce = pce -> parent ));
412
+ } else {
413
+ phpdbg_writeln ("|-------- User Class %s (not yet linked because declaration for parent was not encountered when declaring the class)" , ZSTR_VAL (ce -> parent_name ));
414
+ }
412
415
}
413
416
414
417
if (ce -> info .user .filename ) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-15268 (heap buffer overflow in phpdbg (zend_hash_num_elements() Zend/zend_hash.h))
3
+ --SKIPIF--
4
+ <?php
5
+ if (function_exists ('opcache_get_status ' )) die ('skip not for opcache because it will link ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ class B extends A {
10
+ }
11
+ class A {
12
+ }
13
+ ?>
14
+ --PHPDBG--
15
+ i classes
16
+ q
17
+ --EXPECTF--
18
+ [Successful compilation of %s]
19
+ prompt> [User Classes (2)]
20
+ User Class B (0)
21
+ |-------- User Class A (not yet linked because declaration for parent was not encountered when declaring the class)
22
+ |---- in %s on line %d
23
+ User Class A (0)
24
+ |---- in %s on line %d
25
+ prompt>
You can’t perform that action at this time.
0 commit comments