Minor improvement of BigArray/pop()

This commit is contained in:
Miroslav Štampar 2026-06-05 13:52:10 +02:00
parent 899447fbae
commit 430399c72a
3 changed files with 20 additions and 10 deletions

View file

@ -151,16 +151,26 @@ class BigArray(list):
with self._lock:
if not self.chunks[-1] and len(self.chunks) > 1:
self.chunks.pop()
filename = self.chunks[-1]
idx = len(self.chunks) - 1
if self.cache and self.cache.index == idx and self.cache.dirty:
self.chunks[-1] = self.cache.data
self.cache.dirty = False
else:
try:
with open(filename, "rb") as f:
self.chunks[-1] = pickle.loads(zlib.decompress(f.read()))
except IOError as ex:
errMsg = "exception occurred while retrieving data "
errMsg += "from a temporary file ('%s')" % ex
raise SqlmapSystemException(errMsg)
try:
filename = self.chunks[-1]
with open(filename, "rb") as f:
self.chunks[-1] = pickle.loads(zlib.decompress(f.read()))
self._os_remove(filename)
self.filenames.discard(filename)
except IOError as ex:
errMsg = "exception occurred while retrieving data "
errMsg += "from a temporary file ('%s')" % ex
raise SqlmapSystemException(errMsg)
except OSError:
pass
return self.chunks[-1].pop()

View file

@ -20,7 +20,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.6.48"
VERSION = "1.10.6.49"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)