MITRECND / chopshop

Protocol Analysis/Decoder Framework
https://chopshop.readthedocs.org/
487 stars 112 forks source link

Bug in lznt1.py causes infinite loop #42

Open crankyflamingo opened 10 years ago

crankyflamingo commented 10 years ago

Came across an xshell sample that caused the LZNT1 compression to infinitely loop. In the below code, len(tmp) was 0. (line 85 ish)

if length >= bp:
    tmp = u[-bp:]
    while length >= len(tmp):
        u += tmp
        length -= len(tmp)
        if not len(tmp):  <- added in fixes the issue.
            break

    u += tmp[:length]

Thanks.