Explorar o código

Disallow length parameter <= 0 for Connection::readBytes.

Daniele Alessandri %!s(int64=15) %!d(string=hai) anos
pai
achega
958c0a3b33
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      lib/Predis.php

+ 3 - 0
lib/Predis.php

@@ -906,6 +906,9 @@ class Connection implements IConnection {
     }
 
     public function readBytes($length) {
+        if ($length == 0) {
+            throw new InvalidArgumentException('Length parameter must be greater than 0');
+        }
         $socket = $this->getSocket();
         $value  = '';
         do {