From dfe5fd2a37c066acceefd1cbaabb50843d571c37 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 10 Jul 2019 10:44:33 +0200 Subject: [PATCH] Avoid invalid array access in fcgi.inc --- sapi/fpm/tests/fcgi.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); -- 2.50.1