php-src/ext
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
..
bcmath BCmath extension code reformatting (#11896) 2023-08-13 16:17:36 +01:00
bz2
calendar Allow easter_date to process years after 2037 on 64bit systems (#11862) 2023-08-04 16:47:04 +01:00
com_dotnet Revert "Call cast_object handler from get_properties_for" 2023-08-07 12:58:12 +02:00
ctype
curl Merge branch 'PHP-8.2' 2023-08-10 15:52:21 +02:00
date Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
dba ext/dba/tests/dba_tcadb.phpt: support pthreadless tokyocabinet (#11648) 2023-08-02 16:50:02 +01:00
dl_test Merge branch 'PHP-8.1' into PHP-8.2 2023-09-01 12:40:07 +02:00
dom Deduplicate ParentNode and ChildNode interface implementations using @implementation-alias 2023-09-10 22:35:58 +02:00
enchant Add ASAN XLEAK support 2023-04-03 08:02:19 +02:00
exif Use a single version of strnlen (#12015) 2023-08-22 17:40:24 +02:00
ffi Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
fileinfo fileinfo: Add test for xz type 2023-07-01 18:37:53 +02:00
filter Merge branch 'PHP-8.2' into PHP-8.3 2023-09-14 11:49:44 +02:00
ftp Merge branch 'PHP-8.2' 2023-07-07 18:01:53 +02:00
gd Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
gettext ext/gettext: resolve underqouting that breaks with autoconf 2.72 (#11427) 2023-07-18 19:02:40 +02:00
gmp Fix gmp_long/gmp_ulong typedef warning on Windows x86 (#11112) 2023-05-07 23:30:12 +02:00
hash Merge branch 'PHP-8.2' into PHP-8.3 2023-09-16 21:28:24 +02:00
iconv Merge branch 'PHP-8.2' 2023-08-19 23:11:23 +01:00
imap Merge branch 'PHP-8.2' 2023-07-10 13:42:44 +02:00
intl Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
json Introduce Zend guard recursion protection 2023-08-24 13:03:14 +01:00
ldap Implement ldap_exop_sync 2023-07-18 12:59:21 +02:00
libxml libxml set error structure simplification proposal (#12054) 2023-08-26 12:11:50 +01:00
mbstring [skip ci] Fix typos discovered by codespell (#12228) 2023-09-18 11:07:17 +01:00
mysqli Remove MySQL 4.1 checks 2023-09-19 15:40:59 +01:00
mysqlnd Sync --enable-mysqlnd-compression-support option (#12006) 2023-08-21 16:38:04 +02:00
oci8 Remove CPP when invoking dtrace utility 2023-08-30 13:40:21 +01:00
odbc [skip ci] Skip leaking odbc test on asan 2023-09-08 11:05:34 +02:00
opcache Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
openssl Improve openssl ext to generate EC keys with custom EC parameters 2023-07-06 15:51:50 +01:00
pcntl ext/pcntl: Remove useless call to zend_get_callable_name() (#12241) 2023-09-18 17:35:36 +01:00
pcre Merge branch 'PHP-8.2' into PHP-8.3 2023-09-18 20:14:47 +02:00
pdo Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
pdo_dblib [skip ci] Fix various typos and grammar issues (#11143) 2023-04-28 11:05:32 +02:00
pdo_firebird Merge branch 'PHP-8.2' 2023-03-28 00:12:28 +02:00
pdo_mysql Remove unused --with-zlib-dir configure option 2023-09-14 22:21:54 +02:00
pdo_oci Add ASAN XLEAK support 2023-04-03 08:02:19 +02:00
pdo_odbc Expose PDO_ODBC_TYPE to userland 2023-08-23 21:20:41 +02:00
pdo_pgsql ext/pdo_pgsql: Improve tests cleanup (#11855) 2023-08-05 02:11:57 +01:00
pdo_sqlite Revert "Skip profiling of sqlite3_step" 2023-09-07 10:35:06 +02:00
pgsql Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
phar Use a single version of strnlen (#12015) 2023-08-22 17:40:24 +02:00
posix Fix use-of-uninitialized-value when calling php_posix_stream_get_fd (#11694) 2023-07-13 15:21:36 +02:00
pspell Add ASAN XLEAK support 2023-04-03 08:02:19 +02:00
random Deprecate MT_RAND_PHP (#11560) 2023-07-07 12:16:48 +02:00
readline Merge branch 'PHP-8.2' 2023-05-26 11:39:56 +02:00
reflection [skip ci] Fix typos discovered by codespell (#12228) 2023-09-18 11:07:17 +01:00
session [skip ci] Fix typos discovered by codespell (#12228) 2023-09-18 11:07:17 +01:00
shmop
simplexml Merge branch 'PHP-8.3' 2023-09-20 21:02:36 +02:00
skeleton
snmp Align the return type of snmp_set_oid_numeric_print() to its aliased funtion 2023-08-14 12:43:33 +02:00
soap Merge branch 'PHP-8.2' 2023-08-28 17:25:15 +02:00
sockets ext/sockets/tests/mcast_ipv6_*.phpt: suppress no-ipv6 warning (#11651) 2023-07-10 16:19:12 +02:00
sodium Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
spl Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18 2023-08-30 22:30:59 +02:00
sqlite3 Use zend_get_gc_buffer_add_fcc() 2023-09-09 20:00:01 +02:00
standard Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (PHP 8.4) 2023-09-20 21:02:51 +02:00
sysvmsg
sysvsem
sysvshm
tidy Merge branch 'PHP-8.1' into PHP-8.2 2023-03-27 16:34:11 +02:00
tokenizer
xml Merge branch 'PHP-8.2' 2023-07-31 19:57:02 +01:00
xmlreader Merge branch 'PHP-8.2' 2023-07-31 20:15:51 -05:00
xmlwriter
xsl Fix uouv on oom on object allocation 2023-08-14 11:10:00 +02:00
zend_test Use zend_error_noreturn for E_ERROR consistently 2023-09-14 11:44:55 +02:00
zip zip: add new test for dynamic files 2023-09-12 11:18:18 +02:00
zlib Move ASAN built to GitHub actions 2023-08-09 14:06:36 +02:00
ext_skel.php