Skip to content

Commit a804258

Browse files
committed
Use ZEND_LONG_UINT_OVFL
1 parent 1cd17b1 commit a804258

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/sockets/sockets.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,9 +2334,9 @@ PHP_FUNCTION(socket_set_option)
23342334
ov = zval_get_long(arg4);
23352335

23362336
// TCP_USER_TIMEOUT unsigned int
2337-
if (ov < 0 || ov > UINT_MAX) {
2337+
if (ZEND_LONG_UINT_OVFL(ov)) {
23382338
zend_argument_value_error(4, "must be of between 0 and %u", UINT_MAX);
2339-
RETURN_FALSE;
2339+
RETURN_THROWS;
23402340
}
23412341

23422342
optlen = sizeof(ov);

ext/sockets/tests/socket_setoption_tcpusertimeout.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var_dump($retval_2);
2727
var_dump($retval_3 === $timeout);
2828
socket_close($socket);
2929
?>
30-
--EXPECT--
31-
socket_setopt(): Argument #4 ($value) must be of between 0 and 4294967295
30+
--EXPECTF--
31+
socket_setopt(): Argument #4 ($value) must be of between 0 and %d
3232
bool(true)
3333
bool(true)

0 commit comments

Comments
 (0)