Merge branch 'PHP-8.2' into PHP-8.3

This commit is contained in:
David Carlier 2024-09-05 01:41:55 +01:00
commit ea83eba590
No known key found for this signature in database
GPG Key ID: CEF290BB40D2086B
4 changed files with 11 additions and 5 deletions

4
NEWS
View File

@ -23,6 +23,10 @@ PHP NEWS
. Fixed bug GH-15654 (Signed integer overflow in ext/dom/nodelist.c).
(nielsdos)
- Fileinfo:
. Fixed bug GH-15752 (Incorrect error message for finfo_file
with an empty filename argument). (DanielEScherzer)
- MySQLnd:
. Fixed bug GH-15432 (Heap corruption when querying a vector). (cmb,
Kamil Tekiela)

View File

@ -373,12 +373,14 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
php_stream_wrapper *wrap;
php_stream_statbuf ssb;
// Implementation is used for both finfo_file() and mimetype_emu()
int buffer_param_num = (mimetype_emu ? 1 : 2);
if (buffer == NULL || buffer_len == 0) {
zend_argument_value_error(1, "cannot be empty");
zend_argument_value_error(buffer_param_num, "cannot be empty");
goto clean;
}
if (CHECK_NULL_PATH(buffer, buffer_len)) {
zend_argument_type_error(1, "must not contain any null bytes");
zend_argument_type_error(buffer_param_num, "must not contain any null bytes");
goto clean;
}

View File

@ -21,8 +21,8 @@ var_dump(finfo_file($fp, '&'));
?>
--EXPECTF--
finfo_file(): Argument #1 ($finfo) must not contain any null bytes
finfo_file(): Argument #1 ($finfo) cannot be empty
finfo_file(): Argument #2 ($filename) must not contain any null bytes
finfo_file(): Argument #2 ($filename) cannot be empty
string(9) "directory"
Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d

View File

@ -25,4 +25,4 @@ try {
string(28) "text/x-php; charset=us-ascii"
string(22) "PHP script, ASCII text"
string(28) "text/plain; charset=us-ascii"
finfo_file(): Argument #1 ($finfo) must not contain any null bytes
finfo_file(): Argument #2 ($filename) must not contain any null bytes