From 53f32c87fa93d498fd10c4424123c4609e9f04aa Mon Sep 17 00:00:00 2001 From: Fred Anthony Date: Tue, 5 Jan 2016 10:55:00 -0500 Subject: [PATCH] Fix for fread terminating before is read. See http://php.net/manual/en/function.fread.php for coniditions that may lead to fread terminating before length parameter. --- redis_session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis_session.php b/redis_session.php index b0bfefb..5f64413 100644 --- a/redis_session.php +++ b/redis_session.php @@ -365,7 +365,7 @@ protected function readBulkReply($reply) // If the amount left to read is less than 1024 then just read the rest, else read 1024 $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read); $response .= fread($this->connection, $block_size); - $read += $block_size; + $read = strlen($response); } // Get rid of the CRLF at the end fread($this->connection, 2);