fix for a dirty reading issue reported by skysbsb@gmail.com (IndexError: list index out of range)

This commit is contained in:
Miroslav Stampar 2011-05-30 06:38:44 +00:00
parent 23d7820de7
commit d5ede6afb4
2 changed files with 16 additions and 8 deletions

View File

@ -333,11 +333,15 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
try:
threadData = getCurrentThreadData()
while threadData.shared.limits and kb.threadContinue:
while kb.threadContinue:
kb.locks.limits.acquire()
if threadData.shared.limits:
num = threadData.shared.limits[-1]
del threadData.shared.limits[-1]
kb.locks.limits.release()
else:
kb.locks.limits.release()
break
output = __errorFields(expression, expressionFields, expressionFieldsList, expected, num, resumeValue)

View File

@ -276,11 +276,15 @@ def unionUse(expression, unpack=True, dump=False):
try:
threadData = getCurrentThreadData()
while threadData.shared.limits and kb.threadContinue:
while kb.threadContinue:
kb.locks.limits.acquire()
if threadData.shared.limits:
num = threadData.shared.limits[-1]
del threadData.shared.limits[-1]
kb.locks.limits.release()
else:
kb.locks.limits.release()
break
if Backend.getIdentifiedDbms() in (DBMS.MSSQL, DBMS.SYBASE):
field = expressionFieldsList[0]