otr4j/otr4j — pull request #4 by languitar (2014-12-30 13:37:28+00:00)
Title: Improve parsing safety

This pull request improves the safety in parsing encrypted OTR messages by adding checks for supported protocol versions and the amount of bytes read from an OtrInputStream. So far, several conditions were not handled at all and resulted in unexpected error conditions.

This PR depends on #3 and the first commit of this commit is simply the cherry-picked commit from #3. So when merging, this commit needs to be removed in case #3 has been merged before. Without #3, the additional checks in this PR cause the unit tests to fail due to the spec mismatch reported in #3.