mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
This commit is contained in:
commit
10dbdc5608
3 changed files with 24 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -41,6 +41,9 @@ PHP NEWS
|
|||
. Fixed bug GH-16385 (Unexpected null returned by session_set_cookie_params).
|
||||
(nielsdos)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug with overflow socket_recvfrom $length argument. (David Carlier)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug GH-16337 (Use-after-free in SplHeap). (nielsdos)
|
||||
|
||||
|
|
|
@ -1452,7 +1452,8 @@ PHP_FUNCTION(socket_recvfrom)
|
|||
|
||||
/* overflow check */
|
||||
/* Shouldthrow ? */
|
||||
if ((arg3 + 2) < 3) {
|
||||
|
||||
if (arg3 <= 0 || arg3 > ZEND_LONG_MAX - 1) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
|
19
ext/sockets/tests/socket_recv_overflow.phpt
Normal file
19
ext/sockets/tests/socket_recv_overflow.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--TEST--
|
||||
socket_recvfrom overflow on length argument
|
||||
--EXTENSIONS--
|
||||
sockets
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
|
||||
die('skip not valid for Windows.');
|
||||
}
|
||||
--FILE--
|
||||
<?php
|
||||
$s = socket_create(AF_UNIX, SOCK_DGRAM, 0);
|
||||
$buf = $end = "";
|
||||
var_dump(socket_recvfrom($s, $buf, PHP_INT_MAX, 0, $end));
|
||||
var_dump(socket_recvfrom($s, $buf, -1, 0, $end));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue