[php-src] Issue #16128: Signed integer overflow in main/php_network.h

From: Date: Mon, 30 Sep 2024 05:22:12 +0000
Subject: [php-src] Issue #16128: Signed integer overflow in main/php_network.h
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-247940@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/16128 Author: YuanchengJiang ### Description The following code: ```php <?php $sockets = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, 0); stream_set_timeout($sockets[1], PHP_INT_MIN-1); var_dump(stream_get_contents($sockets[1], 3)); ``` Resulted in this output: ``` /php-src/main/php_network.h:164:29: runtime error: signed integer overflow: -9223372036854775808 * 1000 cannot be represented in type 'long' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/main/php_network.h:164:29 ``` ### PHP Version PHP 8.4.0-dev ### Operating System ubuntu 22.04

« previous php.bugs (#247940) next »