mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix memory leak in array_diff() with custom type checks
This commit is contained in:
3
NEWS
3
NEWS
@@ -5,6 +5,9 @@ PHP NEWS
|
||||
- Core:
|
||||
. Sync all boost.context files with release 1.86.0. (mvorisek)
|
||||
|
||||
- Standard:
|
||||
. Fix memory leak in array_diff() with custom type checks. (ndossche)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug GH-20329 (opcache.file_cache broken with full interned string
|
||||
buffer). (Arnaud)
|
||||
|
||||
@@ -5902,6 +5902,7 @@ PHP_FUNCTION(array_diff)
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (Z_TYPE(args[i]) != IS_ARRAY) {
|
||||
zend_tmp_string_release(tmp_search_str);
|
||||
zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_value_name(&args[i]));
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
array_diff() memory leak with custom type checks
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
array_diff([123], 'x');
|
||||
} catch (TypeError $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array_diff(): Argument #2 must be of type array, string given
|
||||
Reference in New Issue
Block a user