Merge pull request #116 from mvschaik/patch-1
Limit memory allocation of get_bytes to 1MB
This commit is contained in:
commit
37d0247301
|
@ -110,7 +110,8 @@ class Message (object):
|
||||||
@rtype: string
|
@rtype: string
|
||||||
"""
|
"""
|
||||||
b = self.packet.read(n)
|
b = self.packet.read(n)
|
||||||
if len(b) < n:
|
max_pad_size = 1<<20 # Limit padding to 1 MB
|
||||||
|
if len(b) < n and n < max_pad_size:
|
||||||
return b + '\x00' * (n - len(b))
|
return b + '\x00' * (n - len(b))
|
||||||
return b
|
return b
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue