From: Nikita Popov Date: Wed, 10 Jul 2019 08:44:33 +0000 (+0200) Subject: Avoid invalid array access in fcgi.inc X-Git-Tag: php-7.4.0beta1~186 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfe5fd2a37c066acceefd1cbaabb50843d571c37;p=php Avoid invalid array access in fcgi.inc --- diff --git a/sapi/fpm/tests/fcgi.inc b/sapi/fpm/tests/fcgi.inc index 7e3ad0514b..f31811aef6 100644 --- a/sapi/fpm/tests/fcgi.inc +++ b/sapi/fpm/tests/fcgi.inc @@ -589,9 +589,7 @@ class Client // but still not get the response requested $startTime = microtime(true); - do { - $resp = $this->readPacket(); - + while ($resp = $this->readPacket()) { if ($resp['type'] == self::STDOUT || $resp['type'] == self::STDERR) { if ($resp['type'] == self::STDERR) { $this->_requests[$resp['requestId']]['state'] = self::REQ_STATE_ERR; @@ -612,7 +610,7 @@ class Client $this->set_ms_timeout($this->_readWriteTimeout); throw new \Exception('Timed out'); } - } while ($resp); + } if (!is_array($resp)) { $info = stream_get_meta_data($this->_sock);