mirror of
https://github.com/predis/predis.git
synced 2026-08-31 12:43:31 +00:00
Check resource before reading (#803)
This commit is contained in:
@@ -333,7 +333,7 @@ class StreamConnection extends AbstractConnection
|
||||
$bytesLeft = ($size += 2);
|
||||
|
||||
do {
|
||||
$chunk = fread($socket, min($bytesLeft, 4096));
|
||||
$chunk = is_resource($socket) ? fread($socket, min($bytesLeft, 4096)) : false;
|
||||
|
||||
if ($chunk === false || $chunk === '') {
|
||||
$this->onConnectionError('Error while reading bytes from the server.');
|
||||
|
||||
Reference in New Issue
Block a user