summaryrefslogtreecommitdiff
path: root/msgpack/fallback.py
diff options
context:
space:
mode:
authorINADA Naoki <songofacandy@gmail.com>2014-03-26 15:37:29 +0900
committerINADA Naoki <songofacandy@gmail.com>2014-03-26 15:37:29 +0900
commit3a9dc1d7eaff590d08a41124db830f4dbfe1d98c (patch)
treef11f001c5e73b8d1c05201a004acee74c2b412e2 /msgpack/fallback.py
parentac4cd0684542182c47ea01bad50ff51d72dadb86 (diff)
parenta72e75d7c81486bc2775b957b22d3b5e13742589 (diff)
downloadmsgpack-python-3a9dc1d7eaff590d08a41124db830f4dbfe1d98c.tar.gz
Merge pull request #94 from msgpack/strict-input-check
Add tests for limits.
Diffstat (limited to 'msgpack/fallback.py')
-rw-r--r--msgpack/fallback.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py
index 55de72c..49323e6 100644
--- a/msgpack/fallback.py
+++ b/msgpack/fallback.py
@@ -633,6 +633,8 @@ class Packer(object):
return ret
def pack_array_header(self, n):
+ if n >= 2**32:
+ raise ValueError
self._fb_pack_array_header(n)
ret = self._buffer.getvalue()
if self._autoreset:
@@ -642,6 +644,8 @@ class Packer(object):
return ret
def pack_map_header(self, n):
+ if n >= 2**32:
+ raise ValueError
self._fb_pack_map_header(n)
ret = self._buffer.getvalue()
if self._autoreset: