Эх сурвалжийг харах

More strict check of the length argument for a network read.

Daniele Alessandri 14 жил өмнө
parent
commit
48728d2672
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      lib/Predis.php

+ 1 - 1
lib/Predis.php

@@ -1419,7 +1419,7 @@ class TcpConnection extends Connection implements IConnectionSingle {
     }
     }
 
 
     public function readBytes($length) {
     public function readBytes($length) {
-        if ($length == 0) {
+        if ($length <= 0) {
             throw new \InvalidArgumentException('Length parameter must be greater than 0');
             throw new \InvalidArgumentException('Length parameter must be greater than 0');
         }
         }
         $socket = $this->getSocket();
         $socket = $this->getSocket();