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

Skip to content

Commit 6f3511d

Browse files
committed
Error chunk length bug fix (reported privately)
1 parent b43c174 commit 6f3511d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/techniques/error/use.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False):
7474
testChar = str(current % 10)
7575
testQuery = "SELECT %s('%s',%d)" % ("REPEAT" if Backend.isDbms(DBMS.MYSQL) else "REPLICATE", testChar, current)
7676
result = unArrayizeValue(_oneShotErrorUse(testQuery, chunkTest=True))
77+
7778
if result and testChar in result:
7879
if result == testChar * current:
7980
kb.errorChunkLength = current
8081
break
8182
else:
82-
current = len(result) - len(kb.chars.stop)
83+
result = re.search(r"\A\w+", result).group(0)
84+
candidate = len(result) - len(kb.chars.stop)
85+
current = candidate if candidate != current else current - 1
8386
else:
8487
current = current / 2
8588

0 commit comments

Comments
 (0)