diff options
author | INADA Naoki <songofacandy@gmail.com> | 2014-03-26 15:37:29 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2014-03-26 15:37:29 +0900 |
commit | 3a9dc1d7eaff590d08a41124db830f4dbfe1d98c (patch) | |
tree | f11f001c5e73b8d1c05201a004acee74c2b412e2 /msgpack/fallback.py | |
parent | ac4cd0684542182c47ea01bad50ff51d72dadb86 (diff) | |
parent | a72e75d7c81486bc2775b957b22d3b5e13742589 (diff) | |
download | msgpack-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.py | 4 |
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: |