mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-05 21:53:11 +03:00
Fix for an Issue #911
This commit is contained in:
parent
9fe6ab749b
commit
80af465ce3
|
@ -33,8 +33,8 @@ class BigArray(list):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.chunks = [[]]
|
self.chunks = [[]]
|
||||||
self.cache = None
|
self.cache = None
|
||||||
self.length = 0
|
|
||||||
self.filenames = set()
|
self.filenames = set()
|
||||||
|
self.protected = False
|
||||||
self._os_remove = os.remove
|
self._os_remove = os.remove
|
||||||
|
|
||||||
def append(self, value):
|
def append(self, value):
|
||||||
|
@ -78,6 +78,14 @@ class BigArray(list):
|
||||||
with open(self.chunks[index], "rb") as fp:
|
with open(self.chunks[index], "rb") as fp:
|
||||||
self.cache = Cache(index, pickle.load(fp), False)
|
self.cache = Cache(index, pickle.load(fp), False)
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
self.protected = True
|
||||||
|
return self.chunks, self.filenames, self.protected
|
||||||
|
|
||||||
|
def __setstate__(self, state):
|
||||||
|
self.__init__()
|
||||||
|
self.chunks, self.filenames, self.protected = state
|
||||||
|
|
||||||
def __getslice__(self, i, j):
|
def __getslice__(self, i, j):
|
||||||
retval = BigArray()
|
retval = BigArray()
|
||||||
i = max(0, len(self) + i if i < 0 else i)
|
i = max(0, len(self) + i if i < 0 else i)
|
||||||
|
@ -120,8 +128,9 @@ class BigArray(list):
|
||||||
return len(self.chunks[-1]) if len(self.chunks) == 1 else (len(self.chunks) - 1) * BIGARRAY_CHUNK_LENGTH + len(self.chunks[-1])
|
return len(self.chunks[-1]) if len(self.chunks) == 1 else (len(self.chunks) - 1) * BIGARRAY_CHUNK_LENGTH + len(self.chunks[-1])
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
for filename in self.filenames:
|
if not self.protected:
|
||||||
try:
|
for filename in self.filenames:
|
||||||
self._os_remove(filename)
|
try:
|
||||||
except:
|
self._os_remove(filename)
|
||||||
pass
|
except:
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user