From 59a34073226d317c8d02e60ee13ac1e7a84cb41c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 23 Dec 2014 08:36:00 +0100 Subject: [PATCH] Patch for an Issue #1057 --- lib/core/bigarray.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/core/bigarray.py b/lib/core/bigarray.py index f9bb76efb..22db383df 100644 --- a/lib/core/bigarray.py +++ b/lib/core/bigarray.py @@ -52,8 +52,13 @@ class BigArray(list): def pop(self): if len(self.chunks[-1]) < 1: self.chunks.pop() - with open(self.chunks[-1], "rb") as fp: - self.chunks[-1] = pickle.load(fp) + try: + with open(self.chunks[-1], "rb") as fp: + self.chunks[-1] = pickle.load(fp) + except IOError, ex: + errMsg = "exception occurred while retrieving data " + errMsg += "from a temporary file ('%s')" % ex + raise SqlmapSystemException, errMsg return self.chunks[-1].pop() def index(self, value): @@ -80,8 +85,13 @@ class BigArray(list): filename = self._dump(self.cache.data) self.chunks[self.cache.index] = filename if not (self.cache and self.cache.index == index): - with open(self.chunks[index], "rb") as fp: - self.cache = Cache(index, pickle.load(fp), False) + try: + with open(self.chunks[index], "rb") as fp: + self.cache = Cache(index, pickle.load(fp), False) + except IOError, ex: + errMsg = "exception occurred while retrieving data " + errMsg += "from a temporary file ('%s')" % ex + raise SqlmapSystemException, errMsg def __getstate__(self): return self.chunks, self.filenames