mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
don't let lazyparser read more data than it can handle
This should fix issue368.
This commit is contained in:
parent
455c371cc5
commit
38036387d3
@ -139,6 +139,11 @@ class lazyparser(object):
|
||||
if self.all: return
|
||||
if data is None:
|
||||
self.dataf.seek(blockstart)
|
||||
if blockstart + blocksize > self.datasize:
|
||||
# the revlog may have grown since we've started running,
|
||||
# but we don't have space in self.index for more entries.
|
||||
# limit blocksize so that we don't get too much data.
|
||||
blocksize = self.datasize - blockstart
|
||||
data = self.dataf.read(blocksize)
|
||||
lend = len(data) / self.s
|
||||
i = blockstart / self.s
|
||||
|
Loading…
Reference in New Issue
Block a user