Skip to content

Commit 37dd21c

Browse files
committed
feedback
1 parent 05342f4 commit 37dd21c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

main/network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ static inline zend_result php_network_set_limit_time(struct timeval *limit_time,
321321
gettimeofday(limit_time, NULL);
322322
const double timeoutmax = (double) PHP_TIMEOUT_ULL_MAX / 1000000.0;
323323

324-
if (limit_time->tv_sec > (timeoutmax - timeout->tv_sec)) {
324+
if (limit_time->tv_sec >= (timeoutmax - timeout->tv_sec)) {
325+
zend_value_error("timeout value overflow");
325326
return FAILURE;
326327
}
327328

@@ -862,7 +863,6 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
862863
#if HAVE_GETTIMEOFDAY
863864
if (UNEXPECTED(php_network_set_limit_time(&limit_time, &working_timeout) == FAILURE)) {
864865
php_network_freeaddresses(psal);
865-
zend_value_error("timeout value overflow");
866866
return -1;
867867
}
868868
#endif

0 commit comments

Comments
 (0)