mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Merge branch 'PHP-8.3'
* PHP-8.3: [ci skip] NEWS [ci skip] NEWS fix: zend-max-execution-timers with negative or high timeout value (#13942) Use return value of getpwuid_r(), not errno (#13969)
This commit is contained in:
commit
af5db45dc9
@ -1554,6 +1554,11 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
|
||||
struct itimerval t_r; /* timeout requested */
|
||||
int signo;
|
||||
|
||||
// Prevent EINVAL error
|
||||
if (seconds < 0 || seconds > 999999999) {
|
||||
seconds = 0;
|
||||
}
|
||||
|
||||
if(seconds) {
|
||||
t_r.it_value.tv_sec = seconds;
|
||||
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
|
||||
|
@ -85,6 +85,11 @@ void zend_max_execution_timer_settime(zend_long seconds) /* {{{ }*/
|
||||
|
||||
timer_t timer = EG(max_execution_timer_timer);
|
||||
|
||||
// Prevent EINVAL error
|
||||
if (seconds < 0 || seconds > 999999999) {
|
||||
seconds = 0;
|
||||
}
|
||||
|
||||
struct itimerspec its;
|
||||
its.it_value.tv_sec = seconds;
|
||||
its.it_value.tv_nsec = its.it_interval.tv_sec = its.it_interval.tv_nsec = 0;
|
||||
|
@ -1009,7 +1009,7 @@ PHP_FUNCTION(posix_getpwuid)
|
||||
try_again:
|
||||
err = getpwuid_r(uid, &_pw, pwbuf, pwbuflen, &retpwptr);
|
||||
if (err || retpwptr == NULL) {
|
||||
if (errno == ERANGE) {
|
||||
if (err == ERANGE) {
|
||||
pwbuflen *= 2;
|
||||
pwbuf = erealloc(pwbuf, pwbuflen);
|
||||
goto try_again;
|
||||
|
Loading…
Reference in New Issue
Block a user