We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dab9d20 commit 691fa14Copy full SHA for 691fa14
ext/sockets/sockets.c
@@ -2331,16 +2331,17 @@ PHP_FUNCTION(socket_set_option)
2331
2332
#if defined(TCP_USER_TIMEOUT)
2333
case TCP_USER_TIMEOUT: {
2334
- ov = zval_get_long(arg4);
+ zend_long timeout timeout = zval_get_long(arg4);
2335
2336
// TCP_USER_TIMEOUT unsigned int
2337
- if (ov < 0 || ov > UINT_MAX) {
+ if (timeout < 0 || timeout > UINT_MAX) {
2338
zend_argument_value_error(4, "must be of between 0 and %u", UINT_MAX);
2339
RETURN_THROWS();
2340
}
2341
2342
- optlen = sizeof(ov);
2343
- opt_ptr = &ov;
+ unsigned int val = (unsigned int)timeout;
+ optlen = sizeof(val);
2344
+ opt_ptr = &val;
2345
break;
2346
2347
#endif
0 commit comments