venomous0x/WhatsAPI — pull request #152 by zjorzzzey (2012-11-09 00:06:23+00:00)
Title: fixes crash while polling for messages

when polling for messages, a chunk of data is read from the socket and fed to `BinTreeNodeReader::nextTree()` which saves the data in its input buffer (`_input`).

The problem occurs when decrypting: when multiple nodes are in the `_input` variable, only the first one gets decrypted, the rest of the data is lost. If the rest of the data was half a message, the next time `BinTreeNode::nextTree()` is executed, it might run into corrupt data.

This probably is not the perfect solution, but WhatsAPI stopped crashing for me after applying this patch..