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

Skip to content

Commit 75c9f91

Browse files
committed
Fixes #2226
1 parent 9ff2dcf commit 75c9f91

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

lib/core/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.10.35"
22+
VERSION = "1.0.10.36"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -544,6 +544,9 @@
544544
# Number of retries for unsuccessful HashDB flush attempts
545545
HASHDB_FLUSH_RETRIES = 3
546546

547+
# Number of retries for unsuccessful HashDB retrieve attempts
548+
HASHDB_RETRIEVE_RETRIES = 3
549+
547550
# Number of retries for unsuccessful HashDB end transaction attempts
548551
HASHDB_END_TRANSACTION_RETRIES = 3
549552

lib/utils/hashdb.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from lib.core.settings import HASHDB_END_TRANSACTION_RETRIES
2222
from lib.core.settings import HASHDB_FLUSH_RETRIES
2323
from lib.core.settings import HASHDB_FLUSH_THRESHOLD
24+
from lib.core.settings import HASHDB_RETRIEVE_RETRIES
2425
from lib.core.settings import UNICODE_ENCODING
2526
from lib.core.threads import getCurrentThreadData
2627
from lib.core.threads import getCurrentThreadName
@@ -76,16 +77,18 @@ def retrieve(self, key, unserialize=False):
7677
hash_ = HashDB.hashKey(key)
7778
retVal = self._write_cache.get(hash_)
7879
if not retVal:
79-
while True:
80+
for _ in xrange(HASHDB_RETRIEVE_RETRIES):
8081
try:
8182
for row in self.cursor.execute("SELECT value FROM storage WHERE id=?", (hash_,)):
8283
retVal = row[0]
8384
except sqlite3.OperationalError, ex:
84-
if not any(_ in getSafeExString(ex) for _ in ("locked", "no such table")):
85-
raise
86-
else:
85+
if any(_ in getSafeExString(ex) for _ in ("locked", "no such table")):
8786
warnMsg = "problem occurred while accessing session file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
8887
singleTimeWarnMessage(warnMsg)
88+
elif "Could not decode" in getSafeExString(ex):
89+
break
90+
else:
91+
raise
8992
except sqlite3.DatabaseError, ex:
9093
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex))
9194
errMsg += "If the problem persists please rerun with `--flush-session`"

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
ebb5826abf7715ff85c4c55de3f0a12f lib/core/settings.py
48+
6a8ec9fbc9d35126fb23488262b6c5b4 lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
c3ace7874a536d801f308cf1fd03df99 lib/core/target.py
@@ -103,7 +103,7 @@ f5d6884cdeed28281187c111d3e49e3b lib/techniques/union/test.py
103103
8cdc8c1e663c3b92a756fb7b02cc3c02 lib/utils/crawler.py
104104
84604ae4cf0f31602b412036b51f5dae lib/utils/deps.py
105105
4dfd3a95e73e806f62372d63bc82511f lib/utils/getch.py
106-
b1e83fc549334fae8f60552dcdad28cb lib/utils/hashdb.py
106+
e6c2695577b9ca40087621f561e9776b lib/utils/hashdb.py
107107
0330607242d4f704ae6d7bba5f52ccae lib/utils/hash.py
108108
a3e885f7d4c6ff05db1156244bb84158 lib/utils/htmlentities.py
109109
cc9c82cfffd8ee9b25ba3af6284f057e lib/utils/__init__.py

0 commit comments

Comments
 (0)