mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
This commit is contained in:
commit
986dfd4e09
3 changed files with 14 additions and 10 deletions
4
NEWS
4
NEWS
|
@ -22,6 +22,10 @@ PHP NEWS
|
||||||
- SimpleXML:
|
- SimpleXML:
|
||||||
. Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
|
. Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
|
||||||
|
|
||||||
|
- Sockets:
|
||||||
|
. Fixed bug GH-16276 (socket_strerror overflow handling with INT_MIN).
|
||||||
|
(David Carlier / cmb)
|
||||||
|
|
||||||
- Streams:
|
- Streams:
|
||||||
. Fixed bug GH-17037 (UAF in user filter when adding existing filter name due
|
. Fixed bug GH-17037 (UAF in user filter when adding existing filter name due
|
||||||
to incorrect error handling). (nielsdos)
|
to incorrect error handling). (nielsdos)
|
||||||
|
|
|
@ -370,7 +370,11 @@ char *sockets_strerror(int error) /* {{{ */
|
||||||
|
|
||||||
#ifndef PHP_WIN32
|
#ifndef PHP_WIN32
|
||||||
if (error < -10000) {
|
if (error < -10000) {
|
||||||
|
if (error == INT_MIN) {
|
||||||
|
error = 2147473648;
|
||||||
|
} else {
|
||||||
error = -error - 10000;
|
error = -error - 10000;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_HSTRERROR
|
#ifdef HAVE_HSTRERROR
|
||||||
buf = hstrerror(error);
|
buf = hstrerror(error);
|
||||||
|
|
|
@ -3,20 +3,16 @@ GH-16267 - overflow on socket_strerror argument
|
||||||
--EXTENSIONS--
|
--EXTENSIONS--
|
||||||
sockets
|
sockets
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (PHP_INT_SIZE != 8) die('skip 64-bit only'); ?>
|
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
var_dump(socket_strerror(-2147483648));
|
||||||
try {
|
try {
|
||||||
socket_strerror(PHP_INT_MIN);
|
socket_strerror(2147483648);
|
||||||
} catch (\ValueError $e) {
|
|
||||||
echo $e->getMessage() . PHP_EOL;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
socket_strerror(PHP_INT_MAX);
|
|
||||||
} catch (\ValueError $e) {
|
} catch (\ValueError $e) {
|
||||||
echo $e->getMessage() . PHP_EOL;
|
echo $e->getMessage() . PHP_EOL;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
socket_strerror(): Argument #1 ($error_code) must be between %s and %s
|
string(%d) "%S"
|
||||||
socket_strerror(): Argument #1 ($error_code) must be between %s and %s
|
socket_strerror(): Argument #1 ($error_code) must be between %i and %d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue