浏览代码

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 {