From acd6b7797f44ac6339508b46522a5545a62c7b4d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 5 Oct 2015 15:18:54 +0200 Subject: [PATCH] Fixes #1446 --- lib/core/common.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 6ff973a58..6bbe947e4 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1875,8 +1875,13 @@ def readCachedFileContent(filename, mode='rb'): with kb.locks.cache: if filename not in kb.cache.content: checkFile(filename) - with openFile(filename, mode) as f: - kb.cache.content[filename] = f.read() + try: + with openFile(filename, mode) as f: + kb.cache.content[filename] = f.read() + except (IOError, OSError, MemoryError), ex: + errMsg = "something went wrong while trying " + errMsg += "to read the content of file '%s' ('%s')" % (filename, ex) + raise SqlmapSystemException(errMsg) return kb.cache.content[filename]