Fix size limit on pack_array_header and pack_map_header.

This commit is contained in:
INADA Naoki 2014-03-26 11:05:53 +09:00
parent e99331d1ab
commit ef5d93d4ea
2 changed files with 6 additions and 2 deletions

View file

@ -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: