소스 검색

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

Daniele Alessandri 15 년 전
부모
커밋
958c0a3b33
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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 {