MITRECND / chopshop

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

Fix for UnboundLocalError #51

Closed lehins closed 9 years ago

lehins commented 9 years ago

Here was the traceback for the error:

Exception in module heartbleed_payloads -- Traceback: 
Traceback (most recent call last):
  File "/..../chopshop/shop/ChopNids.py", line 566, in handleTcpStreams
    output = code.handleStream(tcpd)
  File "/..../chopshop/modules/heartbleed_payloads.py", line 93, in handleStream
    tcp.discard(count)
UnboundLocalError: local variable 'count' referenced before assignment

This PR implements a simple fix. Will close #50 in favor of this PR.

wxsBSD commented 9 years ago

I committed a better fix. While the server bytes will eventually get discarded it is best to discard them early. Thanks for catching this.