diff --git a/lib/core/convert.py b/lib/core/convert.py index b7ac02809..a925bba67 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -184,7 +184,7 @@ def _serializeDecode(struct): # that would surface as 'bytes' and break str consumers - most visibly kb.chars, # whose str-key lookups then return None and crash cleanupPayload(). Recover such # cross-version TEXT by decoding valid UTF-8 to 'str'; real binary stays bytes. - if struct.get("pv") == 3: + if struct.get("pv") == 3 or not six.PY3: return raw try: return raw.decode("utf-8") diff --git a/lib/core/settings.py b/lib/core/settings.py index ebf0cb0bb..75a6ee242 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.7.108" +VERSION = "1.10.7.109" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/tests/test_pagecontent.py b/tests/test_pagecontent.py index 6d777ef21..4dd903fa0 100644 --- a/tests/test_pagecontent.py +++ b/tests/test_pagecontent.py @@ -24,6 +24,7 @@ bootstrap() from lib.core.common import (getFilteredPageContent, getPageWordSet, extractTextTagContent, parseSqliteTableSchema) +from lib.core.data import conf from lib.core.data import kb @@ -60,8 +61,14 @@ class TestExtractTextTagContent(unittest.TestCase): class TestParseSqliteTableSchema(unittest.TestCase): def setUp(self): + # parseSqliteTableSchema keys cachedColumns by conf.db/conf.tbl - reset them (not just + # cachedColumns) so a leaked db/tbl from a prior test can't shift the storage key and + # break this test's [None][None] lookup (order-dependent flake under PyPy discovery) self.addCleanup(setattr, kb.data, "cachedColumns", kb.data.get("cachedColumns")) + self.addCleanup(setattr, conf, "db", conf.get("db")) + self.addCleanup(setattr, conf, "tbl", conf.get("tbl")) kb.data.cachedColumns = {} + conf.db = conf.tbl = None def _cols(self): # parseSqliteTableSchema stores under cachedColumns[db][table] (both None here)