Add a test specifically for damaged transaction headers.
We're still missing tests that cover important cases. Unexecuted code below: >>>>>> if l > len(data) - 8: >>>>>> pos += l >>>>>> break >>>>>> s = l + 1 >>>>>> tl = u64(data[s:s+8]) >>>>>> if tl < pos: >>>>>> return pos + s + 8 >>>>>> except: >>>>>> if partial and nrec: >>>>>> ofs._status = 'p' >>>>>> ofs.tpc_vote(transaction) >>>>>> ofs.tpc_finish(transaction) >>>>>> if verbose: >>>>>> print 'partial' else: >>>>>> ofs.tpc_abort(transaction) >>>>>> print "\n%s: %s\n" % sys.exc_info()[:2] >>>>>> if not verbose: >>>>>> progress(prog1) >>>>>> pos = scan(file, pos)
Showing
Please register or sign in to comment