php-src/sapi/phpdbg
Niels Dossche 8a812c3fda Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (PHP 8.4)
When we try to load an extension multiple times, we still overwrite the
type, module number, and handle. If the module number is used to
indicate module boundaries (e.g. in reflection and in dom, see e.g.
dom_objects_set_class_ex), then all sorts of errors can happen.

In the case of ext/dom, OP's error happens because the following
happens:
- The property handler is set up incorrectly in
  dom_objects_set_class_ex() because the wrong module number is
  specified. The class highest in the hierarchy is DOMNode, so the
  property handler is incorrectly set to that of DOMNode instead of
  DOMDocument.
- The documentElement property doesn't exist on DOMNode, it only exists
  on DOMDocument, so it tries to read using zend_std_read_property().
  As there is no user property called documentElement, that read
  operation returns an undef value.
  However, the type is still checked, resulting in the strange exception.

Solve this by changing the API such that the data is only overwritten if
it's owned data.

Closes GH-12246.
2023-09-20 21:02:51 +02:00
..
tests Add string output escaping into zend dump (phpdbg + opcache debug) (#11337) 2023-05-29 16:45:00 +03:00
.gdbinit
.phpdbginit Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
config.m4 Fix configure phpdbg help output (#12013) 2023-08-22 02:52:06 +01:00
config.w32 replace phpdbg custom opcode dumper with O+ dump (#7227) 2021-07-13 15:32:14 +02:00
create-test.php Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
CREDITS
Makefile.frag Drop test-phpdbg and clean-phpdbg targets 2021-05-14 12:20:00 +02:00
phpdbg.1.in [skip ci] Update year to 2023 (#10374) 2023-01-19 12:01:29 +01:00
phpdbg.c Revert "Remove name field from the zend_constant struct (#10954)" 2023-07-17 22:32:41 +02:00
phpdbg.h Replace php_stdint.h header with standard headers (#8613) 2022-05-29 11:20:56 +01:00
phpdbg.init.d Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
phpdbg.stub.php Declare phpdbg constants in stubs (#9392) 2022-08-21 19:05:17 +02:00
phpdbg_arginfo.h Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
phpdbg_bp.c zend_compiler, ...: use uint8_t instead of zend_uchar (#10621) 2023-02-23 14:56:54 +00:00
phpdbg_bp.h zend_compiler, ...: use uint8_t instead of zend_uchar (#10621) 2023-02-23 14:56:54 +00:00
phpdbg_break.c replace phpdbg custom opcode dumper with O+ dump (#7227) 2021-07-13 15:32:14 +02:00
phpdbg_break.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_btree.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_btree.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_cmd.c Change if (stack) check to an assertion (#10090) 2022-12-13 13:16:52 +01:00
phpdbg_cmd.h remove specialized printing from phpdbg (#7156) 2021-06-17 14:22:33 +02:00
phpdbg_frame.c More usage of known zend_str instead of C string (#11381) 2023-06-08 13:03:29 +01:00
phpdbg_frame.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_help.c Merge branch 'PHP-8.2' 2023-07-07 19:19:53 +02:00
phpdbg_help.h Make globals const (part 2) (#10610) 2023-02-18 19:52:53 +00:00
phpdbg_info.c Revert "Remove name field from the zend_constant struct (#10954)" 2023-07-17 22:32:41 +02:00
phpdbg_info.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_io.c Revert GH-10220 2023-01-16 12:27:33 +01:00
phpdbg_io.h ditch remote 2021-06-13 21:08:35 +02:00
phpdbg_lexer.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_lexer.l PHPDBG: fix bug parsing 3-word opcodes 2021-04-22 10:11:26 +02:00
phpdbg_list.c Support specifying start position in compile_string 2021-09-30 10:21:33 +02:00
phpdbg_list.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_out.c Fix GH-10715: phpdbg heap buffer overflow -- by misuse of the option "--run" 2023-02-27 19:47:55 +00:00
phpdbg_out.h remove specialized printing from phpdbg (#7156) 2021-06-17 14:22:33 +02:00
phpdbg_parser.y Suppress unused-but-set-variable warning in parsers 2022-07-28 22:29:42 +02:00
phpdbg_print.c Use more compact representation for packed arrays. 2021-11-03 15:18:26 +03:00
phpdbg_print.h replace phpdbg custom opcode dumper with O+ dump (#7227) 2021-07-13 15:32:14 +02:00
phpdbg_prompt.c Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (PHP 8.4) 2023-09-20 21:02:51 +02:00
phpdbg_prompt.h drop phpdbg web helper extension and wait command (#7144) 2021-06-13 14:02:11 +02:00
phpdbg_set.c replace phpdbg custom opcode dumper with O+ dump (#7227) 2021-07-13 15:32:14 +02:00
phpdbg_set.h replace phpdbg custom opcode dumper with O+ dump (#7227) 2021-07-13 15:32:14 +02:00
phpdbg_sigsafe.c Replace zend_bool uses with bool 2021-01-15 12:33:06 +01:00
phpdbg_sigsafe.h Replace zend_bool uses with bool 2021-01-15 12:33:06 +01:00
phpdbg_utils.c Merge branch 'PHP-8.2' 2023-01-17 14:16:37 +00:00
phpdbg_utils.h remove specialized printing from phpdbg (#7156) 2021-06-17 14:22:33 +02:00
phpdbg_watch.c More usage of known zend_str instead of C string (#11381) 2023-06-08 13:03:29 +01:00
phpdbg_watch.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_win.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
phpdbg_win.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
test.php Apply tidy formatting 2020-02-03 13:41:31 +01:00
web-bootstrap.php Rename non-existing site phpdbg.com to localhost 2019-02-19 20:21:20 +01:00