Patch for an Issue #944

This commit is contained in:
Miroslav Stampar 2014-11-16 14:25:44 +01:00
parent bb56eb583a
commit 733e06e31f
2 changed files with 15 additions and 6 deletions

View File

@ -13,6 +13,7 @@ except:
import os import os
import tempfile import tempfile
from lib.core.exception import SqlmapSystemException
from lib.core.settings import BIGARRAY_CHUNK_LENGTH from lib.core.settings import BIGARRAY_CHUNK_LENGTH
class Cache(object): class Cache(object):
@ -63,12 +64,17 @@ class BigArray(list):
return ValueError, "%s is not in list" % value return ValueError, "%s is not in list" % value
def _dump(self, value): def _dump(self, value):
try:
handle, filename = tempfile.mkstemp(prefix="sqlmapba-") handle, filename = tempfile.mkstemp(prefix="sqlmapba-")
self.filenames.add(filename) self.filenames.add(filename)
os.close(handle) os.close(handle)
with open(filename, "w+b") as fp: with open(filename, "w+b") as fp:
pickle.dump(value, fp, pickle.HIGHEST_PROTOCOL) pickle.dump(value, fp, pickle.HIGHEST_PROTOCOL)
return filename return filename
except IOError, ex:
errMsg = "exception occurred while storing data "
errMsg += "to a temporary file ('%s')" % ex
raise SqlmapSystemException, errMsg
def _checkcache(self, index): def _checkcache(self, index):
if (self.cache and self.cache.index != index and self.cache.dirty): if (self.cache and self.cache.index != index and self.cache.dirty):

View File

@ -53,6 +53,9 @@ class SqlmapShellQuitException(SqlmapBaseException):
class SqlmapSyntaxException(SqlmapBaseException): class SqlmapSyntaxException(SqlmapBaseException):
pass pass
class SqlmapSystemException(SqlmapBaseException):
pass
class SqlmapThreadException(SqlmapBaseException): class SqlmapThreadException(SqlmapBaseException):
pass pass