From b2e4a128c4b0da2442a55389d27c8229f76874c3 Mon Sep 17 00:00:00 2001 From: Eugene Leonovich Date: Mon, 14 Mar 2016 16:57:24 +0100 Subject: [PATCH] Restrict space:select()'s default limit value to be <= uint32 Also, on 32/64-bit Windows PHP_INT_MAX is equal to 2147483647, on 32-bit Linux it's 4294967295 and on 64-bit Linux 9223372036854775807. --- src/Schema/Space.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Schema/Space.php b/src/Schema/Space.php index 4821afe8..ad3393bf 100644 --- a/src/Schema/Space.php +++ b/src/Schema/Space.php @@ -34,7 +34,7 @@ public function select(array $key = null, $index = null, $limit = null, $offset { $key = null === $key ? [] : $key; $offset = null === $offset ? 0 : $offset; - $limit = null === $limit ? PHP_INT_MAX : $limit; + $limit = null === $limit ? PHP_INT_MAX & 0xffffffff : $limit; $iteratorType = null === $iteratorType ? 0 : $iteratorType; $index = $this->normalizeIndex($index);