From 8e8f6f842c78fd29a81dc108803355d29cb18168 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 10 Feb 2010 09:27:34 +0000 Subject: [PATCH] fix for that md5 error reported by Dani (lgrecol@gmail.com) --- lib/controller/checks.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index e17aab220..84eca8845 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -33,6 +33,7 @@ from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core.exception import sqlmapConnectionException +from lib.core.exception import unhandledException from lib.core.session import setString from lib.core.session import setRegexp from lib.request.connect import Connect as Request @@ -293,13 +294,19 @@ def checkStability(): time.sleep(1) secondPage, _ = Request.queryPage(content=True) - condition = firstPage == secondPage + condition = (firstPage == secondPage) if condition: - conf.md5hash = md5hash(firstPage) - - logMsg = "url is stable" - logger.info(logMsg) + if firstPage: + conf.md5hash = md5hash(firstPage) + logMsg = "url is stable" + logger.info(logMsg) + else: + exceptionMsg = "there was an error checking the stability of page " + exceptionMsg += "because of lack of content. please check the " + exceptionMsg += "page request results (and probable errors) by " + exceptionMsg += "using higher verbosity levels" + raise unhandledException, exceptionMsg elif not condition: warnMsg = "url is not stable, sqlmap will base the page "