From 6f3511dcc3aac4e14572393b9993538f605dd731 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 8 Jan 2016 10:45:31 +0100 Subject: [PATCH] Error chunk length bug fix (reported privately) --- lib/techniques/error/use.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index 1d3e51034..3ddcf91c4 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -74,12 +74,15 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False): testChar = str(current % 10) testQuery = "SELECT %s('%s',%d)" % ("REPEAT" if Backend.isDbms(DBMS.MYSQL) else "REPLICATE", testChar, current) result = unArrayizeValue(_oneShotErrorUse(testQuery, chunkTest=True)) + if result and testChar in result: if result == testChar * current: kb.errorChunkLength = current break else: - current = len(result) - len(kb.chars.stop) + result = re.search(r"\A\w+", result).group(0) + candidate = len(result) - len(kb.chars.stop) + current = candidate if candidate != current else current - 1 else: current = current / 2