Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 733e06e

Browse files
committed
Patch for an Issue #944
1 parent bb56eb5 commit 733e06e

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

lib/core/bigarray.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import os
1414
import tempfile
1515

16+
from lib.core.exception import SqlmapSystemException
1617
from lib.core.settings import BIGARRAY_CHUNK_LENGTH
1718

1819
class Cache(object):
@@ -63,12 +64,17 @@ def index(self, value):
6364
return ValueError, "%s is not in list" % value
6465

6566
def _dump(self, value):
66-
handle, filename = tempfile.mkstemp(prefix="sqlmapba-")
67-
self.filenames.add(filename)
68-
os.close(handle)
69-
with open(filename, "w+b") as fp:
70-
pickle.dump(value, fp, pickle.HIGHEST_PROTOCOL)
71-
return filename
67+
try:
68+
handle, filename = tempfile.mkstemp(prefix="sqlmapba-")
69+
self.filenames.add(filename)
70+
os.close(handle)
71+
with open(filename, "w+b") as fp:
72+
pickle.dump(value, fp, pickle.HIGHEST_PROTOCOL)
73+
return filename
74+
except IOError, ex:
75+
errMsg = "exception occurred while storing data "
76+
errMsg += "to a temporary file ('%s')" % ex
77+
raise SqlmapSystemException, errMsg
7278

7379
def _checkcache(self, index):
7480
if (self.cache and self.cache.index != index and self.cache.dirty):

lib/core/exception.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class SqlmapShellQuitException(SqlmapBaseException):
5353
class SqlmapSyntaxException(SqlmapBaseException):
5454
pass
5555

56+
class SqlmapSystemException(SqlmapBaseException):
57+
pass
58+
5659
class SqlmapThreadException(SqlmapBaseException):
5760
pass
5861

0 commit comments

Comments
 (0)